/* Oregon Wash concierge chat widget */

#ow-chat {
  position: fixed;
  bottom: 20px;
  right: 20px;
  z-index: 950;
  font-family: var(--font-body, system-ui);
}
/* leave room for the mobile thumb-bar */
@media (max-width: 780px) {
  #ow-chat { bottom: 88px; right: 12px; }
}

/* Slide-in opener bubble */
#ow-chat-opener {
  display: flex; align-items: flex-start; gap: 10px;
  background: #101a2c; color: #fff;
  border-radius: 14px;
  padding: 12px 16px 12px 12px;
  max-width: 320px;
  box-shadow: 0 8px 24px rgba(10, 20, 40, 0.28);
  cursor: pointer;
  opacity: 0; transform: translateY(12px);
  transition: opacity 0.25s ease, transform 0.25s ease;
}
#ow-chat-opener.show { opacity: 1; transform: translateY(0); }
#ow-chat-opener:hover { background: #182a48; }
#ow-chat-opener .avatar {
  flex: 0 0 34px; height: 34px; width: 34px;
  border-radius: 50%; background: var(--ow-green, #6DB33F);
  display: flex; align-items: center; justify-content: center;
  font-weight: 800; color: #fff; font-size: 0.9rem;
}
#ow-chat-opener .msg {
  font-size: 0.9rem; line-height: 1.35;
  padding-top: 2px;
}
#ow-chat-opener .msg strong { display: block; font-size: 0.72rem; text-transform: uppercase; letter-spacing: 0.06em; color: var(--ow-green, #6DB33F); font-weight: 800; margin-bottom: 2px; }
#ow-chat-opener .x {
  position: absolute; top: 4px; right: 6px;
  background: none; border: 0; color: #98a5b8;
  cursor: pointer; font-size: 1rem; padding: 4px 8px; border-radius: 999px;
}
#ow-chat-opener .x:hover { background: rgba(255,255,255,0.08); color: #fff; }

/* Round chat button when opener is dismissed */
#ow-chat-btn {
  display: none; align-items: center; justify-content: center;
  width: 60px; height: 60px; border-radius: 50%;
  background: var(--ow-green, #6DB33F); color: #fff;
  border: 0; cursor: pointer;
  box-shadow: 0 8px 24px rgba(10, 20, 40, 0.28);
  font-size: 1.7rem;
  transition: transform 0.15s ease, background 0.15s ease;
}
#ow-chat-btn:hover { background: var(--ow-green-deep, #4E8929); transform: scale(1.05); }
#ow-chat-btn .badge {
  position: absolute; top: -4px; right: -4px;
  background: #d64545; color: #fff;
  border-radius: 999px; padding: 2px 7px;
  font-size: 0.72rem; font-weight: 800; font-family: system-ui;
  border: 2px solid #fff;
  display: none;
}
#ow-chat-btn .badge.show { display: block; }

/* Chat panel */
#ow-chat-panel {
  display: none;
  width: 360px; max-width: calc(100vw - 24px);
  height: 520px; max-height: calc(100vh - 40px);
  background: #fff; border-radius: 16px;
  box-shadow: 0 24px 60px rgba(10, 20, 40, 0.35);
  overflow: hidden;
  flex-direction: column;
}
#ow-chat-panel.show { display: flex; }
#ow-chat-panel .head {
  background: #101a2c; color: #fff;
  padding: 14px 16px;
  display: flex; align-items: center; gap: 10px;
}
#ow-chat-panel .head .avatar {
  flex: 0 0 34px; height: 34px; width: 34px;
  border-radius: 50%; background: var(--ow-green, #6DB33F);
  display: flex; align-items: center; justify-content: center;
  font-weight: 800; font-size: 0.9rem;
}
#ow-chat-panel .head .title { font-weight: 800; font-size: 0.95rem; line-height: 1.2; }
#ow-chat-panel .head .status { font-size: 0.72rem; color: #90b478; margin-top: 2px; display: flex; align-items: center; gap: 5px; }
#ow-chat-panel .head .status .dot { width: 7px; height: 7px; border-radius: 50%; background: var(--ow-green, #6DB33F); }
#ow-chat-panel .head .status.away .dot { background: #c88500; }
#ow-chat-panel .head .status.away { color: #f4b942; }
#ow-chat-panel .head .close {
  margin-left: auto; background: none; border: 0; color: #98a5b8;
  cursor: pointer; font-size: 1.4rem; padding: 4px 10px; border-radius: 999px; line-height: 1;
}
#ow-chat-panel .head .close:hover { background: rgba(255,255,255,0.08); color: #fff; }

#ow-chat-panel .thread {
  flex: 1; overflow-y: auto; padding: 14px;
  background: #f7f9fc;
  display: flex; flex-direction: column; gap: 10px;
}
#ow-chat-panel .bubble {
  max-width: 82%; padding: 9px 13px; border-radius: 14px;
  font-size: 0.9rem; line-height: 1.4;
  white-space: pre-wrap; word-wrap: break-word;
}
#ow-chat-panel .bubble.owner { align-self: flex-start; background: #fff; color: #1a2333; border-bottom-left-radius: 4px; box-shadow: 0 1px 2px rgba(10,20,40,0.06); }
#ow-chat-panel .bubble.visitor { align-self: flex-end; background: var(--ow-navy, #0F2E5F); color: #fff; border-bottom-right-radius: 4px; }
#ow-chat-panel .bubble.system { align-self: center; background: #eef1f5; color: #6a6a78; font-size: 0.8rem; padding: 6px 12px; border-radius: 999px; max-width: 90%; text-align: center; }
#ow-chat-panel .bubble .who { display: block; font-size: 0.7rem; font-weight: 700; color: #98a5b8; margin-bottom: 2px; text-transform: uppercase; letter-spacing: 0.04em; }
#ow-chat-panel .bubble.visitor .who { color: #90b478; }

#ow-chat-panel .quick {
  padding: 8px 12px 0; display: flex; flex-wrap: wrap; gap: 6px;
  background: #f7f9fc;
}
#ow-chat-panel .quick button {
  background: #fff; border: 1px solid rgba(15,46,95,0.15);
  color: var(--ow-navy, #0F2E5F); font-family: inherit;
  font-size: 0.8rem; font-weight: 600;
  padding: 6px 12px; border-radius: 999px; cursor: pointer;
}
#ow-chat-panel .quick button:hover { background: var(--ow-navy, #0F2E5F); color: #fff; border-color: var(--ow-navy, #0F2E5F); }

#ow-chat-panel .compose {
  border-top: 1px solid rgba(15,46,95,0.08);
  padding: 10px 12px;
  background: #fff;
}
#ow-chat-panel .compose .identify {
  display: none; gap: 8px; margin-bottom: 8px;
}
#ow-chat-panel .compose .identify.show { display: flex; }
#ow-chat-panel .compose .identify input {
  flex: 1; min-width: 0;
  padding: 8px 10px; border: 1px solid rgba(15,46,95,0.15); border-radius: 8px;
  font-size: 0.88rem; font-family: inherit;
}
#ow-chat-panel .compose .row {
  display: flex; gap: 8px; align-items: flex-end;
}
#ow-chat-panel .compose textarea {
  flex: 1; min-height: 40px; max-height: 120px;
  padding: 9px 12px; border: 1px solid rgba(15,46,95,0.15); border-radius: 10px;
  font-family: inherit; font-size: 0.9rem; resize: none;
  outline: none;
}
#ow-chat-panel .compose textarea:focus { border-color: var(--ow-green, #6DB33F); }
#ow-chat-panel .compose button.send {
  background: var(--ow-green, #6DB33F); color: #fff; border: 0; cursor: pointer;
  padding: 0 16px; height: 40px; border-radius: 10px;
  font-family: inherit; font-weight: 700; font-size: 0.9rem;
}
#ow-chat-panel .compose button.send:hover { background: var(--ow-green-deep, #4E8929); }
#ow-chat-panel .compose button.send:disabled { background: #c0c8d0; cursor: not-allowed; }

@media (max-width: 480px) {
  #ow-chat-panel { width: calc(100vw - 24px); height: 78vh; }
}
