/* ============================================================
   Dirt Free Carpet — Chat Assistant widget
   Self-contained, browser-only. Matched to the site's navy + brass theme.
   ============================================================ */
.dfc-chat, .dfc-chat * { box-sizing: border-box; }
.dfc-chat {
  --dfc-navy: #0c1420;
  --dfc-navy-2: #121d2c;
  --dfc-line: rgba(216, 178, 122, 0.22);
  --dfc-brass: #b08a4a;
  --dfc-brass-glow: #d8b27a;
  --dfc-cream: #f3ede1;
  --dfc-muted: rgba(243, 237, 225, 0.55);
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}

/* Launcher button */
.dfc-launch {
  position: fixed; right: 22px; bottom: 22px; z-index: 2147483000;
  width: 60px; height: 60px; border-radius: 50%;
  border: none; cursor: pointer;
  background: linear-gradient(145deg, #c79e5a, #b08a4a);
  color: #0c1420; display: flex; align-items: center; justify-content: center;
  box-shadow: 0 12px 32px -8px rgba(176, 138, 74, 0.55), 0 4px 12px rgba(0,0,0,0.3);
  transition: transform .25s ease, box-shadow .25s ease;
}
.dfc-launch:hover { transform: translateY(-3px) scale(1.04); box-shadow: 0 18px 40px -8px rgba(176,138,74,.7); }
.dfc-launch svg { width: 26px; height: 26px; }
.dfc-launch .dfc-launch-close { display: none; }
.dfc-chat.dfc-open .dfc-launch .dfc-launch-open { display: none; }
.dfc-chat.dfc-open .dfc-launch .dfc-launch-close { display: block; }
.dfc-launch .dfc-badge {
  position: absolute; top: -3px; right: -3px; min-width: 20px; height: 20px;
  background: #c0392b; color: #fff; border-radius: 10px; font-size: 11px; font-weight: 700;
  display: flex; align-items: center; justify-content: center; padding: 0 5px;
  border: 2px solid var(--dfc-navy); animation: dfc-pulse 1.8s infinite;
}
@keyframes dfc-pulse { 0%,100% { transform: scale(1);} 50% { transform: scale(1.12);} }

/* Panel */
.dfc-panel {
  position: fixed; right: 22px; bottom: 94px; z-index: 2147483000;
  width: 380px; max-width: calc(100vw - 32px);
  height: 560px; max-height: calc(100vh - 130px);
  background: var(--dfc-navy);
  border: 1px solid var(--dfc-line);
  border-radius: 14px; overflow: hidden;
  display: flex; flex-direction: column;
  box-shadow: 0 24px 64px -16px rgba(0,0,0,.6);
  opacity: 0; visibility: hidden; transform: translateY(14px) scale(.98);
  transition: opacity .22s ease, transform .22s ease, visibility .22s;
}
.dfc-chat.dfc-open .dfc-panel { opacity: 1; visibility: visible; transform: translateY(0) scale(1); }

/* Header */
.dfc-head {
  padding: 16px 18px; display: flex; align-items: center; gap: 11px;
  background: linear-gradient(180deg, var(--dfc-navy-2), var(--dfc-navy));
  border-bottom: 1px solid var(--dfc-line);
}
.dfc-dot { width: 10px; height: 10px; border-radius: 50%; background: var(--dfc-brass-glow); box-shadow: 0 0 10px var(--dfc-brass-glow); flex: none; }
.dfc-head-txt { flex: 1; min-width: 0; }
.dfc-head-title { font-family: 'Fraunces', Georgia, serif; color: var(--dfc-cream); font-size: 1.02rem; line-height: 1.1; }
.dfc-head-title em { color: var(--dfc-brass-glow); font-style: italic; }
.dfc-head-sub { font-size: .72rem; color: var(--dfc-muted); margin-top: 2px; letter-spacing: .02em; }
.dfc-head-x { background: none; border: none; color: var(--dfc-muted); cursor: pointer; padding: 4px; border-radius: 6px; }
.dfc-head-x:hover { color: var(--dfc-cream); background: rgba(255,255,255,.06); }

/* Messages */
.dfc-body { flex: 1; overflow-y: auto; padding: 18px 16px 8px; display: flex; flex-direction: column; gap: 12px; scroll-behavior: smooth; }
.dfc-body::-webkit-scrollbar { width: 7px; }
.dfc-body::-webkit-scrollbar-thumb { background: rgba(216,178,122,.25); border-radius: 4px; }
.dfc-msg { max-width: 84%; padding: 10px 13px; font-size: .87rem; line-height: 1.5; border-radius: 13px; white-space: pre-wrap; word-wrap: break-word; }
.dfc-msg a { color: var(--dfc-brass-glow); text-decoration: underline; }
.dfc-msg.dfc-bot { align-self: flex-start; background: var(--dfc-navy-2); color: var(--dfc-cream); border: 1px solid var(--dfc-line); border-bottom-left-radius: 4px; }
.dfc-msg.dfc-user { align-self: flex-end; background: linear-gradient(145deg, #c79e5a, #b08a4a); color: #0c1420; font-weight: 500; border-bottom-right-radius: 4px; }
.dfc-msg strong { font-weight: 700; }

/* Typing */
.dfc-typing { align-self: flex-start; display: flex; gap: 4px; padding: 12px 14px; background: var(--dfc-navy-2); border: 1px solid var(--dfc-line); border-radius: 13px; border-bottom-left-radius: 4px; }
.dfc-typing span { width: 7px; height: 7px; border-radius: 50%; background: var(--dfc-brass-glow); opacity: .5; animation: dfc-bounce 1.2s infinite; }
.dfc-typing span:nth-child(2){ animation-delay:.2s; } .dfc-typing span:nth-child(3){ animation-delay:.4s; }
@keyframes dfc-bounce { 0%,60%,100%{ transform: translateY(0); opacity:.4; } 30%{ transform: translateY(-5px); opacity:1; } }

/* Quick replies */
.dfc-qr { display: flex; flex-wrap: wrap; gap: 7px; padding: 2px 16px 10px; }
.dfc-qr button {
  background: transparent; border: 1px solid var(--dfc-line); color: var(--dfc-brass-glow);
  font-family: inherit; font-size: .78rem; padding: 7px 13px; border-radius: 20px; cursor: pointer;
  transition: all .18s ease;
}
.dfc-qr button:hover { background: var(--dfc-brass); color: #0c1420; border-color: var(--dfc-brass); }

/* Input */
.dfc-foot { border-top: 1px solid var(--dfc-line); padding: 10px 12px; background: var(--dfc-navy-2); }
.dfc-inputrow { display: flex; gap: 8px; align-items: flex-end; }
.dfc-input {
  flex: 1; resize: none; max-height: 90px;
  background: var(--dfc-navy); border: 1px solid var(--dfc-line); color: var(--dfc-cream);
  font-family: inherit; font-size: .87rem; padding: 10px 12px; border-radius: 10px; outline: none;
}
.dfc-input::placeholder { color: rgba(243,237,225,.35); }
.dfc-input:focus { border-color: var(--dfc-brass); }
.dfc-send {
  flex: none; width: 40px; height: 40px; border-radius: 10px; border: none; cursor: pointer;
  background: linear-gradient(145deg, #c79e5a, #b08a4a); color: #0c1420;
  display: flex; align-items: center; justify-content: center; transition: transform .15s ease;
}
.dfc-send:hover { transform: scale(1.06); } .dfc-send:disabled { opacity: .4; cursor: default; transform: none; }
.dfc-trust { text-align: center; font-size: .66rem; color: rgba(243,237,225,.35); padding: 7px 0 2px; }

@media (max-width: 480px) {
  .dfc-panel { right: 10px; left: 10px; width: auto; bottom: 86px; height: calc(100vh - 110px); }
  .dfc-launch { right: 16px; bottom: 16px; }
}
