/* WebPro NC — public chat widget */
.wpn-chat-root {
  position: fixed;
  right: 18px;
  bottom: 18px;
  z-index: 85;
  font-family: Inter, system-ui, sans-serif;
  color: #e8eaed;
}
.wpn-chat-launcher {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 12px 16px;
  border: 0;
  border-radius: 999px;
  background: linear-gradient(180deg, #e07a56, #d05a37);
  color: #fff;
  font-weight: 700;
  font-size: 0.92rem;
  cursor: pointer;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.35);
}
.wpn-chat-launcher:hover { filter: brightness(1.05); }
.wpn-chat-launcher-icon { display: flex; }
.wpn-chat-panel {
  position: absolute;
  right: 0;
  bottom: 58px;
  width: min(380px, calc(100vw - 24px));
  max-height: min(640px, calc(100dvh - 96px), calc(100vh - 96px));
  display: flex;
  flex-direction: column;
  background: #12161c;
  border: 1px solid rgba(243, 240, 232, 0.12);
  border-radius: 16px;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.45);
  overflow: hidden;
}
.wpn-chat-panel[hidden] { display: none !important; }
/* Author display:flex rules beat the UA [hidden] rule — force hide */
.wpn-chat-gate[hidden],
.wpn-chat-thread[hidden],
.wpn-chat-compose[hidden],
.wpn-chat-typing[hidden],
.wpn-chat-wait[hidden],
.wpn-chat-icon-btn[hidden],
.wpn-chat-error[hidden] {
  display: none !important;
}
.wpn-chat-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 10px;
  padding: 14px 14px 12px;
  border-bottom: 1px solid rgba(243, 240, 232, 0.1);
  background: #171c23;
  flex-shrink: 0;
}
.wpn-chat-header strong { display: block; font-size: 0.98rem; }
.wpn-chat-status { font-size: 0.75rem; color: #9aa4ad; margin-top: 3px; }
.wpn-chat-header-actions { display: flex; gap: 6px; }
.wpn-chat-icon-btn {
  border: 1px solid rgba(243, 240, 232, 0.14);
  background: transparent;
  color: #cfd6dd;
  border-radius: 8px;
  padding: 4px 10px;
  cursor: pointer;
  font-size: 0.85rem;
  line-height: 1.2;
}
.wpn-chat-gate {
  display: flex;
  flex-direction: column;
  flex: 1 1 auto;
  min-height: 0;
  overflow: hidden;
  padding: 0;
}
.wpn-chat-gate-scroll {
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  padding: 14px 14px 8px;
  overscroll-behavior: contain;
}
.wpn-chat-gate-actions {
  flex-shrink: 0;
  padding: 10px 14px calc(14px + env(safe-area-inset-bottom, 0px));
  border-top: 1px solid rgba(243, 240, 232, 0.1);
  background: #12161c;
}
.wpn-chat-gate-intro { font-size: 0.86rem; color: #9aa4ad; margin: 0 0 12px; }
.wpn-chat-field { display: flex; flex-direction: column; gap: 5px; margin-bottom: 10px; font-size: 0.78rem; color: #9aa4ad; font-weight: 600; letter-spacing: 0.04em; text-transform: uppercase; }
.wpn-chat-field input, .wpn-chat-compose textarea, .wpn-chat-gate input[type="text"], .wpn-chat-gate input[type="email"], .wpn-chat-gate input[type="number"] {
  width: 100%;
  padding: 10px 12px;
  border-radius: 10px;
  border: 1px solid rgba(243, 240, 232, 0.22);
  background: #0e1218;
  color: #f2f3f6;
  font: inherit;
  text-transform: none;
  letter-spacing: normal;
  font-weight: 400;
  font-size: 0.92rem;
}
.wpn-chat-hp { position: absolute; left: -9999px; opacity: 0; height: 0; overflow: hidden; }
.wpn-chat-topic-field { position: relative; }
.wpn-chat-topic-wrap {
  position: relative;
  display: flex;
  align-items: stretch;
}
.wpn-chat-topic-wrap input {
  flex: 1;
  padding-right: 40px !important;
}
.wpn-chat-topic-toggle {
  position: absolute;
  right: 4px;
  top: 50%;
  transform: translateY(-50%);
  width: 32px;
  height: 32px;
  border: 0;
  background: transparent;
  color: #9aa4ad;
  cursor: pointer;
  font-size: 14px;
  border-radius: 8px;
}
.wpn-chat-topic-toggle:hover { color: #e8eaed; background: rgba(255,255,255,.06); }
.wpn-chat-topic-list {
  position: absolute;
  left: 0;
  right: 0;
  top: calc(100% + 4px);
  z-index: 20;
  margin: 0;
  padding: 4px 0;
  list-style: none;
  max-height: 180px;
  overflow: auto;
  background: #171c23;
  border: 1px solid rgba(243, 240, 232, 0.16);
  border-radius: 10px;
  box-shadow: 0 12px 28px rgba(0,0,0,.45);
}
.wpn-chat-topic-list[hidden] { display: none !important; }
.wpn-chat-topic-list li {
  padding: 9px 12px;
  font-size: 0.88rem;
  font-weight: 500;
  color: #e8eaed;
  cursor: pointer;
  text-transform: none;
  letter-spacing: normal;
}
.wpn-chat-topic-list li:hover,
.wpn-chat-topic-list li.active {
  background: rgba(208, 90, 55, 0.16);
}
.wpn-chat-topic-list li.wpn-chat-topic-custom {
  border-top: 1px solid rgba(243, 240, 232, 0.1);
  color: #c9d0d6;
  font-size: 0.82rem;
}
.wpn-chat-topic-list li.wpn-chat-topic-empty {
  color: #9aa4ad;
  cursor: default;
  font-size: 0.8rem;
}
.wpn-chat-topic-hint {
  display: block;
  margin-top: 5px;
  font-size: 0.7rem;
  color: #8b949e;
  font-weight: 500;
  letter-spacing: 0;
  text-transform: none;
}
.wpn-chat-primary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  padding: 11px 14px;
  border: 0;
  border-radius: 10px;
  background: linear-gradient(180deg, #e07a56, #d05a37);
  color: #fff;
  font-weight: 700;
  cursor: pointer;
  font-size: 0.9rem;
}
.wpn-chat-primary:disabled { opacity: 0.55; cursor: not-allowed; }
.wpn-chat-error { color: #f0a090; font-size: 0.85rem; margin: 0 0 10px; }
.wpn-chat-thread {
  flex: 1;
  overflow: auto;
  padding: 12px 14px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  min-height: 220px;
  max-height: 340px;
}
.wpn-chat-bubble {
  max-width: 88%;
  padding: 8px 11px;
  border-radius: 12px;
  font-size: 0.9rem;
  line-height: 1.5;
  word-break: break-word;
}
.wpn-chat-bubble.visitor { align-self: flex-end; background: rgba(208, 90, 55, 0.22); border: 1px solid rgba(208, 90, 55, 0.35); }
.wpn-chat-bubble.operator, .wpn-chat-bubble.ai { align-self: flex-start; background: rgba(255, 255, 255, 0.06); border: 1px solid rgba(243, 240, 232, 0.12); }
.wpn-chat-bubble.system { align-self: center; color: #9aa4ad; font-size: 0.78rem; background: transparent; border: 0; text-align: center; max-width: 95%; }
.wpn-chat-bubble .who { display: block; font-size: 0.65rem; text-transform: uppercase; letter-spacing: 0.06em; color: #9aa4ad; margin-bottom: 2px; font-weight: 700; }
.wpn-chat-msg-body { white-space: normal; word-break: break-word; }
.wpn-chat-msg-body .wpn-chat-p { margin: 0 0 0.55em; }
.wpn-chat-msg-body .wpn-chat-p:last-child { margin-bottom: 0; }
.wpn-chat-msg-body a.wpn-chat-link,
.wpn-chat-link {
  color: #ffb5a0;
  font-weight: 600;
  text-decoration: underline;
  text-underline-offset: 2px;
  word-break: break-all;
}
.wpn-chat-link:hover { color: #ffc9b8; }
.wpn-chat-typing, .wpn-chat-wait {
  padding: 0 14px 6px;
  font-size: 0.78rem;
  color: #9aa4ad;
  min-height: 1.1em;
}
.wpn-chat-compose {
  display: flex;
  gap: 8px;
  padding: 10px 14px 12px;
  flex-shrink: 0;
  border-top: 1px solid rgba(243, 240, 232, 0.1);
  align-items: flex-end;
}
.wpn-chat-compose-wrap { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 4px; }
.wpn-chat-compose textarea { resize: none; min-height: 42px; max-height: 110px; width: 100%; box-sizing: border-box; }
.wpn-chat-compose-hint {
  font-size: 0.58rem;
  color: #6d7680;
  letter-spacing: 0.02em;
  line-height: 1.25;
  opacity: 0.9;
  font-weight: 500;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.wpn-chat-compose-hint kbd {
  display: inline-block;
  padding: 0 3px;
  border-radius: 2px;
  border: 1px solid rgba(255,255,255,.1);
  background: rgba(0,0,0,.2);
  font-size: 0.55rem;
  font-family: inherit;
  font-weight: 600;
  line-height: 1.4;
  vertical-align: baseline;
}
.wpn-chat-send { width: auto; padding: 11px 16px; flex-shrink: 0; }
.wpn-chat-attach-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 42px;
  height: 42px;
  flex-shrink: 0;
  border-radius: 10px;
  border: 1px solid rgba(243, 240, 232, 0.14);
  background: transparent;
  color: #cfd6dd;
  cursor: pointer;
  font-size: 1.1rem;
  line-height: 1;
  margin: 0;
}
.wpn-chat-attach-btn:hover { border-color: rgba(208, 90, 55, 0.45); background: rgba(208, 90, 55, 0.1); }
.wpn-chat-file-label {
  font-size: 0.72rem;
  color: #ffb5a0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 100%;
}
.wpn-chat-attach { margin-top: 8px; display: flex; flex-direction: column; gap: 6px; }
.wpn-chat-attach-img { max-width: 100%; max-height: 160px; border-radius: 8px; object-fit: contain; background: rgba(0,0,0,.25); }
.wpn-chat-attach-link { color: #ffb5a0; font-size: 0.82rem; font-weight: 600; text-decoration: none; word-break: break-all; }
.wpn-chat-attach-link:hover { text-decoration: underline; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); border: 0; }
.wpn-chat-slider-wrap {
  margin: 8px 0 12px;
  user-select: none;
  width: 100%;
}
.wpn-chat-slider-wrap .wpn-slider-label,
.wpn-chat-slider-wrap .human-slider-hint {
  display: block;
  font-size: 0.72rem;
  color: #9aa4ad;
  margin-bottom: 6px;
  font-weight: 600;
  letter-spacing: 0.03em;
  line-height: 1.35;
  text-transform: none;
}
.wpn-chat-slider-status {
  font-size: 0.7rem;
  font-family: ui-monospace, monospace;
  color: #9aa4ad;
  margin-bottom: 6px;
  min-height: 1.1em;
}
.wpn-chat-slider-track {
  position: relative;
  height: 28px;
  width: 100%;
  border-radius: 999px;
  background: #0e1218;
  border: 1px solid rgba(243, 240, 232, 0.18);
  overflow: hidden;
}
.wpn-chat-slider-zone {
  position: absolute;
  top: 0; bottom: 0;
  background: rgba(61, 139, 110, 0.4);
  border-left: 1px solid rgba(61, 139, 110, 0.8);
  border-right: 1px solid rgba(61, 139, 110, 0.8);
  z-index: 1;
  pointer-events: none;
}
.wpn-chat-slider-fill {
  position: absolute;
  left: 0; top: 0; bottom: 0;
  width: 0;
  background: rgba(208, 90, 55, 0.4);
  border-radius: 999px;
  z-index: 0;
}
.wpn-chat-slider-knob {
  position: absolute;
  top: 2px;
  left: 2px;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: #d05a37;
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-size: 12px;
  cursor: grab;
  z-index: 2;
  touch-action: none;
}
.wpn-chat-slider-verified {
  margin-top: 8px;
  font-size: 0.7rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: #9ed7bf;
  font-weight: 700;
  text-align: left;
  line-height: 1.2;
}
.wpn-chat-slider-verified[hidden] { display: none !important; }
.wpn-chat-slider-wrap.is-complete .wpn-chat-slider-knob { background: #3d8b6e; }
.wpn-chat-slider-wrap.is-complete .wpn-chat-slider-fill { background: rgba(61, 139, 110, 0.5); }
.wpn-chat-slider-wrap.is-complete .wpn-chat-slider-status { color: #9ed7bf; }
@media (max-width: 480px) {
  .wpn-chat-root {
    right: max(10px, env(safe-area-inset-right));
    bottom: max(10px, env(safe-area-inset-bottom));
  }
  .wpn-chat-launcher-label { display: none; }
  .wpn-chat-panel {
    width: min(100vw - 16px, 380px);
    right: 0;
    bottom: 54px;
    max-height: min(620px, calc(100dvh - 88px), calc(100vh - 88px));
  }
  .wpn-chat-field { margin-bottom: 8px; }
  .wpn-chat-field input { padding: 9px 11px; }
  .wpn-chat-gate-scroll { padding: 12px 12px 6px; }
  .wpn-chat-gate-actions { padding: 10px 12px calc(12px + env(safe-area-inset-bottom, 0px)); }
}
