/* ── Sentinel live chat widget ─────────────────────────── */

.sd-chat-root {
  position: fixed;
  right: 22px;
  bottom: 22px;
  z-index: 9000;
  font-family: var(--sans, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif);
  font-size: 14px;
  line-height: 1.5;
}

.sd-chat-btn {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: #ff6b35;
  border: 0;
  color: #0b0f14;
  cursor: pointer;
  box-shadow: 0 6px 24px rgba(0, 0, 0, 0.35);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.15s ease, background 0.15s ease;
  position: relative;
}

.sd-chat-btn:hover { transform: translateY(-2px); background: #ff8358; }
.sd-chat-btn svg { width: 26px; height: 26px; }

.sd-chat-badge {
  position: absolute;
  top: -2px;
  right: -2px;
  background: #30a46c;
  color: #fff;
  font-size: 10px;
  font-weight: 700;
  min-width: 18px;
  height: 18px;
  border-radius: 9px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 5px;
  border: 2px solid #0b0f14;
}

.sd-chat-panel {
  position: absolute;
  right: 0;
  bottom: 72px;
  width: 360px;
  max-width: calc(100vw - 32px);
  height: 520px;
  max-height: calc(100vh - 110px);
  background: #0e141b;
  border: 1px solid #25303b;
  border-radius: 10px;
  box-shadow: 0 12px 48px rgba(0, 0, 0, 0.5);
  display: none;
  flex-direction: column;
  overflow: hidden;
}

.sd-chat-panel.open { display: flex; }

.sd-chat-head {
  padding: 16px 18px;
  background: #0b0f14;
  border-bottom: 1px solid #25303b;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.sd-chat-head-title {
  font-weight: 700;
  font-size: 0.94rem;
  color: #e6edf3;
  letter-spacing: -0.01em;
}

.sd-chat-head-sub {
  font-size: 0.72rem;
  color: #9aa7b4;
  margin-top: 2px;
}

.sd-chat-head-hours {
  font-size: 0.68rem;
  color: #6b7280;
  margin-top: 3px;
  letter-spacing: 0.02em;
}

.sd-chat-head-hours:empty { display: none; }

.sd-chat-close {
  background: transparent;
  border: 0;
  color: #9aa7b4;
  font-size: 20px;
  cursor: pointer;
  padding: 4px 8px;
  line-height: 1;
}

.sd-chat-close:hover { color: #e6edf3; }

.sd-chat-body {
  flex: 1;
  overflow-y: auto;
  padding: 18px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.sd-chat-intro {
  color: #9aa7b4;
  font-size: 0.86rem;
  margin-bottom: 6px;
}

.sd-chat-intro strong { color: #e6edf3; font-weight: 600; }

.sd-chat-msg {
  max-width: 82%;
  padding: 10px 14px;
  border-radius: 12px;
  font-size: 0.88rem;
  line-height: 1.5;
  word-wrap: break-word;
  white-space: pre-wrap;
}

.sd-chat-msg.visitor {
  align-self: flex-end;
  background: #ff6b35;
  color: #0b0f14;
  border-bottom-right-radius: 4px;
}

.sd-chat-msg.admin {
  align-self: flex-start;
  background: #1c2438;
  color: #e6edf3;
  border-bottom-left-radius: 4px;
}

.sd-chat-msg-meta {
  font-size: 0.68rem;
  color: #6b7280;
  margin-top: 4px;
}

.sd-chat-msg.visitor .sd-chat-msg-meta {
  color: rgba(11, 15, 20, 0.55);
  text-align: right;
}

.sd-chat-system {
  align-self: center;
  text-align: center;
  font-size: 0.78rem;
  color: #9aa7b4;
  padding: 6px 14px;
  background: rgba(154, 167, 180, 0.08);
  border-radius: 20px;
  max-width: 90%;
}

.sd-chat-footer {
  border-top: 1px solid #25303b;
  padding: 12px 14px;
  display: flex;
  gap: 8px;
  align-items: flex-end;
  background: #0b0f14;
}

.sd-chat-footer textarea {
  flex: 1;
  background: #121820;
  border: 1px solid #25303b;
  border-radius: 8px;
  color: #e6edf3;
  padding: 10px 12px;
  font-family: inherit;
  font-size: 0.9rem;
  outline: none;
  resize: none;
  min-height: 40px;
  max-height: 100px;
  transition: border-color 0.15s ease;
}

.sd-chat-footer textarea:focus { border-color: #ff6b35; }
.sd-chat-footer textarea::placeholder { color: #5b6875; }
.sd-chat-footer textarea:disabled { opacity: 0.5; cursor: not-allowed; }

.sd-chat-send {
  background: #ff6b35;
  border: 0;
  color: #0b0f14;
  font-weight: 700;
  padding: 11px 18px;
  border-radius: 8px;
  cursor: pointer;
  font-size: 0.85rem;
  font-family: inherit;
  transition: background 0.15s ease;
}

.sd-chat-send:hover { background: #ff8358; }
.sd-chat-send:disabled { opacity: 0.4; cursor: not-allowed; }

.sd-chat-lock {
  padding: 16px 18px;
  background: rgba(255, 179, 71, 0.06);
  border-top: 1px solid #25303b;
  font-size: 0.82rem;
  color: #ffb347;
  text-align: center;
  line-height: 1.65;
}

.sd-chat-lock a {
  color: #ff6b35;
  text-decoration: underline;
}

.sd-chat-lock a:hover { color: #ff8358; }

.sd-chat-lock strong { color: #e6edf3; font-weight: 600; }

@media (max-width: 480px) {
  .sd-chat-root { right: 14px; bottom: 14px; }
  .sd-chat-panel {
    width: calc(100vw - 28px);
    right: -8px;
    bottom: 68px;
    height: 70vh;
  }
}
