/* Namostee Design Studio — "Chat with Sam" site chat.
   Namostee's own chat: no third-party service. A dark pill in the site's
   style opens a panel themed by the site's day/night variables. The widget
   is created by chat.js only after the maintenance gate lifts its veil,
   so a locked page never shows it. */

.samchat-btn {
  position: fixed; right: 18px; bottom: 18px; z-index: 290;
  display: inline-flex; align-items: center; gap: 10px;
  height: 52px; padding: 0 20px 0 8px; border-radius: 999px;
  background: #0d0b10; color: #f4f5f9;
  border: 1px solid rgba(244, 245, 249, 0.28);
  box-shadow: 0 14px 34px rgba(13, 11, 16, 0.35);
  font: inherit; font-size: 15px; font-weight: 600; letter-spacing: 0.01em;
  cursor: pointer; transition: filter 0.2s ease, transform 0.15s ease;
}
.samchat-btn:hover { filter: brightness(1.3); }
.samchat-btn:active { transform: scale(0.98); }
.samchat-btn:focus-visible { outline: 2px solid var(--accent-deep, #c32b96); outline-offset: 3px; }
.samchat-badge-s {
  width: 36px; height: 36px; flex: none; border-radius: 50%;
  background: var(--accent, #ff83da); color: #0d0b10;
  display: flex; align-items: center; justify-content: center;
  font-weight: 800; font-size: 17px;
}
.samchat-unread {
  position: absolute; top: -4px; right: -4px; min-width: 22px; height: 22px;
  padding: 0 6px; border-radius: 999px; display: none;
  background: var(--accent-deep, #c32b96); color: #fff;
  font-size: 12px; font-weight: 700; line-height: 22px; text-align: center;
  border: 2px solid var(--paper, #fff);
}
.samchat-unread.on { display: block; }

.samchat-panel {
  position: fixed; right: 18px; bottom: 82px; z-index: 291;
  width: min(380px, calc(100vw - 24px));
  height: min(580px, calc(100dvh - 110px));
  display: none; flex-direction: column; overflow: hidden;
  background: var(--paper, #fff); color: var(--ink, #1c1b1c);
  border: 1px solid var(--line, #dcdfe9); border-radius: 24px;
  box-shadow: 0 24px 60px rgba(13, 11, 16, 0.30);
}
.samchat-panel.open { display: flex; }
.samchat-head {
  display: flex; align-items: center; gap: 10px;
  padding: 14px 16px; background: #0d0b10; color: #f4f5f9; flex: none;
}
.samchat-head .samchat-badge-s { width: 32px; height: 32px; font-size: 15px; }
.samchat-title { font-size: 16px; font-weight: 700; letter-spacing: -0.01em; }
.samchat-sub { font-size: 12px; color: rgba(244, 245, 249, 0.72); margin-top: 1px; }
.samchat-close {
  margin-left: auto; flex: none; width: 34px; height: 34px; border-radius: 50%;
  border: 1px solid rgba(244, 245, 249, 0.32); background: transparent;
  color: #f4f5f9; font-size: 17px; line-height: 1; cursor: pointer;
}
.samchat-close:hover { background: rgba(244, 245, 249, 0.12); }
.samchat-note {
  flex: none; padding: 10px 16px; font-size: 13px; color: var(--muted, #716d82);
  background: var(--soft, #f4f5f9); border-bottom: 1px solid var(--line, #dcdfe9);
}
.samchat-who { flex: none; padding: 12px 16px 4px; display: grid; gap: 8px; }
.samchat-who label { font-size: 12px; font-weight: 600; color: var(--muted, #716d82); display: grid; gap: 4px; }
.samchat-who input {
  font: inherit; font-size: 14px; padding: 9px 12px; border-radius: 12px;
  border: 1px solid var(--line, #dcdfe9); background: var(--paper, #fff); color: var(--ink, #1c1b1c);
}
.samchat-who input:focus-visible { outline: 2px solid var(--accent-deep, #c32b96); outline-offset: 1px; }
.samchat-who .hint { font-size: 12px; color: var(--muted, #716d82); }
.samchat-who.saved { display: none; }
.samchat-msgs {
  flex: 1; overflow-y: auto; padding: 14px 16px; display: flex;
  flex-direction: column; gap: 8px;
}
.samchat-msg {
  max-width: 82%; padding: 9px 13px; border-radius: 16px;
  font-size: 14px; line-height: 1.45; white-space: pre-wrap; word-break: break-word;
}
.samchat-msg .who { display: block; font-size: 11px; font-weight: 700; margin-bottom: 2px; opacity: 0.75; }
.samchat-msg.visitor {
  align-self: flex-end; background: var(--accent-soft, #f7e1f7);
  color: var(--ink, #1c1b1c); border-bottom-right-radius: 6px;
}
.samchat-msg.sam {
  align-self: flex-start; background: var(--soft, #f4f5f9);
  color: var(--ink, #1c1b1c); border: 1px solid var(--line, #dcdfe9);
  border-bottom-left-radius: 6px;
}
.samchat-empty { font-size: 13px; color: var(--muted, #716d82); text-align: center; padding: 12px 8px; }
.samchat-form {
  flex: none; display: flex; gap: 8px; padding: 12px;
  border-top: 1px solid var(--line, #dcdfe9); background: var(--paper, #fff);
}
.samchat-form textarea {
  flex: 1; font: inherit; font-size: 14px; resize: none; max-height: 96px;
  padding: 10px 13px; border-radius: 14px;
  border: 1px solid var(--line, #dcdfe9); background: var(--paper, #fff); color: var(--ink, #1c1b1c);
}
.samchat-form textarea:focus-visible { outline: 2px solid var(--accent-deep, #c32b96); outline-offset: 1px; }
.samchat-send {
  flex: none; align-self: flex-end; height: 42px; padding: 0 18px; border: none;
  border-radius: 999px; background: var(--cta-bg, #c32b96); color: var(--cta-ink, #fff);
  font: inherit; font-size: 14px; font-weight: 700; cursor: pointer;
}
.samchat-send:hover { background: var(--cta-bg-hover, #a8247f); }
.samchat-send:disabled { opacity: 0.55; cursor: default; }
.samchat-err { flex: none; padding: 0 16px 10px; font-size: 12.5px; color: #b3261e; display: none; }
.samchat-err.on { display: block; }

@media (max-width: 640px) {
  .samchat-btn { right: 12px; bottom: 12px; }
  .samchat-panel { right: 12px; bottom: 74px; }
}
@media (prefers-reduced-motion: reduce) {
  .samchat-btn { transition: none; }
}
