/* Chat widget for הזכות שלך. Uses the page's design tokens, so it follows the
   palette and dark mode without a second theme. */

.zc-btn {
  position: fixed;
  inset-inline-end: 16px;
  bottom: 18px;
  z-index: 40;
  display: inline-flex;
  align-items: center;
  gap: 9px;
  padding: 13px 18px;
  border: 0;
  border-radius: 999px;
  background: var(--brand);
  color: var(--brand-ink);
  font: inherit;
  font-weight: 800;
  font-size: 15px;
  cursor: pointer;
  box-shadow: 0 8px 24px rgba(15, 26, 38, .28);
}
.zc-btn .dot {
  width: 8px; height: 8px; border-radius: 50%;
  background: #35d07f; box-shadow: 0 0 0 3px rgba(53, 208, 127, .22);
}
.zc-btn[hidden] { display: none; }

.zc-panel {
  position: fixed;
  inset-inline-end: 16px;
  bottom: 78px;
  z-index: 41;
  width: min(390px, calc(100vw - 24px));
  max-height: min(620px, calc(100vh - 120px));
  display: flex;
  flex-direction: column;
  background: var(--panel);
  color: var(--ink);
  border: 1px solid var(--line);
  border-radius: 18px;
  box-shadow: 0 18px 60px rgba(15, 26, 38, .28);
  overflow: hidden;
}
.zc-panel[hidden] { display: none; }

.zc-head {
  display: flex; align-items: center; gap: 10px;
  padding: 12px 14px;
  border-bottom: 1px solid var(--line);
  background: var(--panel);
}
.zc-head .mark {
  width: 32px; height: 32px; border-radius: 9px; flex: none;
  display: grid; place-items: center;
  background: var(--brand); color: var(--brand-ink);
  font-weight: 900;
}
.zc-head b { display: block; font-size: 15px; line-height: 1.15; }
.zc-head small { display: block; font-size: 11.5px; color: var(--muted); }
.zc-close {
  margin-inline-start: auto;
  border: 0; background: transparent; color: var(--muted);
  font-size: 24px; line-height: 1; cursor: pointer; padding: 2px 6px;
}

.zc-log {
  flex: 1;
  overflow-y: auto;
  padding: 14px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  scroll-behavior: smooth;
}
.zc-msg {
  max-width: 88%;
  padding: 9px 12px;
  border-radius: 14px;
  font-size: 14.5px;
  line-height: 1.45;
  white-space: pre-wrap;
  word-break: break-word;
}
.zc-msg.bot {
  align-self: flex-start;
  background: var(--bg);
  border: 1px solid var(--line);
  border-start-start-radius: 5px;
}
.zc-msg.me {
  align-self: flex-end;
  background: var(--brand);
  color: var(--brand-ink);
  border-start-end-radius: 5px;
}
.zc-msg.typing { color: var(--muted); font-style: italic; }
.zc-msg.note { background: transparent; border: 0; color: var(--muted); font-size: 12.5px; max-width: 100%; }

.zc-chips { display: flex; flex-wrap: wrap; gap: 6px; padding: 0 14px 10px; }
.zc-chips button {
  border: 1px solid var(--line);
  background: var(--bg);
  color: var(--ink);
  border-radius: 999px;
  padding: 6px 11px;
  font: inherit;
  font-size: 13px;
  cursor: pointer;
}
.zc-chips button:hover { border-color: var(--accent); }

.zc-form { display: flex; gap: 8px; padding: 10px 12px 12px; border-top: 1px solid var(--line); }
.zc-form input {
  flex: 1; min-width: 0;
  padding: 11px 12px;
  border: 1.5px solid var(--line);
  border-radius: 10px;
  background: var(--bg);
  color: var(--ink);
  font: inherit; font-size: 15px;
}
.zc-form input:focus { outline: 2px solid color-mix(in srgb, var(--accent) 55%, transparent); border-color: var(--accent); }
.zc-form button {
  border: 0; border-radius: 10px;
  padding: 0 16px;
  background: var(--accent); color: var(--accent-ink);
  font: inherit; font-weight: 900; cursor: pointer;
}
.zc-form button:disabled { opacity: .55; cursor: default; }

.zc-capture {
  margin: 0 12px 12px;
  padding: 12px;
  border: 1px solid color-mix(in srgb, var(--accent) 45%, var(--line));
  border-radius: 12px;
  background: color-mix(in srgb, var(--accent) 8%, var(--panel));
}
.zc-capture b { display: block; font-size: 14.5px; margin-bottom: 2px; }
.zc-capture p { margin: 0 0 8px; font-size: 12.5px; color: var(--muted); }
.zc-capture input[type="text"], .zc-capture input[type="tel"] {
  width: 100%; margin-bottom: 6px;
  padding: 9px 10px;
  border: 1.5px solid var(--line);
  border-radius: 9px;
  background: var(--panel);
  color: var(--ink);
  font: inherit; font-size: 14.5px;
}
.zc-capture label.consent {
  display: flex; gap: 8px; align-items: flex-start;
  font-size: 11.5px; color: var(--muted); margin: 4px 0 8px;
}
.zc-capture label.consent input { width: 16px; height: 16px; flex: none; margin-top: 2px; }
.zc-capture button.send {
  width: 100%; padding: 10px; border: 0; border-radius: 9px;
  background: var(--accent); color: var(--accent-ink);
  font: inherit; font-weight: 900; cursor: pointer;
}
.zc-capture button.send:disabled { opacity: .55; cursor: default; }
.zc-capture .err { color: #c02626; font-size: 12.5px; font-weight: 700; margin: 6px 0 0; }
.zc-hp { position: absolute; left: -9999px; width: 1px; height: 1px; opacity: 0; }

@media (max-width: 760px) {
  .zc-btn { bottom: 78px; }
  .zc-panel {
    inset-inline: 0;
    bottom: 0;
    width: 100%;
    max-height: 82vh;
    border-radius: 18px 18px 0 0;
    border-bottom: 0;
  }
  .zc-panel.open ~ .zc-btn { display: none; }
}
