/* chadnixonhomes.com chat widget. Navy #10233d, gold #c9a227. Scoped under .cnh-chat */
.cnh-chat, .cnh-chat * { box-sizing: border-box; }
.cnh-chat { --cn-navy: #10233d; --cn-navy-2: #1a3a5c; --cn-gold: #c9a227; --cn-gold-soft: #f7f1de; --cn-bg: #f8fafc; --cn-line: #e2e8f0; --cn-text: #334155;
  font-family: "Source Sans 3", system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif; color: var(--cn-text); line-height: 1.5; }

.cnh-launcher { position: fixed; right: 20px; bottom: 20px; z-index: 210; display: inline-flex; align-items: center; gap: .55rem;
  min-height: 52px; padding: .7rem 1.15rem .7rem .9rem; border-radius: 999px; border: 2px solid var(--cn-gold);
  background: var(--cn-navy); color: #fff; font: 700 .98rem/1.2 inherit; font-family: inherit; cursor: pointer;
  box-shadow: 0 10px 28px rgba(16,35,61,.28); transition: transform .15s, box-shadow .15s; }
.cnh-launcher:hover { transform: translateY(-2px); box-shadow: 0 14px 32px rgba(16,35,61,.32); }
.cnh-launcher:focus-visible, .cnh-chat button:focus-visible, .cnh-chat input:focus-visible, .cnh-chat select:focus-visible, .cnh-chat textarea:focus-visible { outline: 3px solid var(--cn-gold); outline-offset: 2px; }
.cnh-launcher svg { width: 24px; height: 24px; flex: none; }
.cnh-launcher .cnh-badge { position: absolute; top: -4px; right: -4px; min-width: 20px; height: 20px; padding: 0 5px; border-radius: 10px; background: var(--cn-gold); color: var(--cn-navy); font-size: .75rem; line-height: 20px; text-align: center; }
.cnh-chat.is-open .cnh-launcher { display: none; }

.cnh-panel { position: fixed; right: 20px; bottom: 20px; z-index: 211; width: 380px; max-width: calc(100vw - 24px); height: min(600px, calc(100vh - 40px));
  display: none; flex-direction: column; background: #fff; border-radius: 16px; overflow: hidden; border: 1px solid var(--cn-line);
  box-shadow: 0 18px 48px rgba(16,35,61,.25); }
.cnh-chat.is-open .cnh-panel { display: flex; animation: cnh-in .18s ease-out; }
@keyframes cnh-in { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }

.cnh-head { display: flex; align-items: center; gap: .75rem; padding: .85rem 1rem; background: var(--cn-navy); color: #fff; border-bottom: 3px solid var(--cn-gold); }
.cnh-avatar { width: 40px; height: 40px; border-radius: 50%; object-fit: cover; border: 2px solid var(--cn-gold); flex: none; background: var(--cn-navy-2); }
.cnh-title { flex: 1; min-width: 0; }
.cnh-title strong { display: block; font-family: "Source Serif 4", Georgia, serif; font-size: 1.05rem; letter-spacing: .01em; }
.cnh-title span { display: flex; align-items: center; gap: .35rem; font-size: .8rem; color: #cbd5e1; }
.cnh-dot { width: 8px; height: 8px; border-radius: 50%; background: #94a3b8; }
.cnh-chat.is-human .cnh-dot { background: var(--cn-gold); box-shadow: 0 0 0 3px rgba(201,162,39,.25); }
.cnh-close { width: 40px; height: 40px; border: 0; border-radius: 50%; background: transparent; color: #fff; font-size: 1.5rem; line-height: 1; cursor: pointer; }
.cnh-close:hover { background: rgba(255,255,255,.12); }

.cnh-log { flex: 1; overflow-y: auto; padding: 1rem; background: var(--cn-bg); display: flex; flex-direction: column; gap: .6rem; overscroll-behavior: contain; }
.cnh-msg { max-width: 86%; padding: .6rem .85rem; border-radius: 14px; font-size: .95rem; white-space: normal; word-wrap: break-word; overflow-wrap: anywhere; }
.cnh-msg p { margin: 0 0 .45rem; } .cnh-msg p:last-child { margin: 0; }
.cnh-msg ul { margin: .2rem 0 .45rem 1.1rem; padding: 0; } .cnh-msg li { margin: .1rem 0; }
.cnh-msg a { color: inherit; text-decoration: underline; text-underline-offset: 2px; }
.cnh-bot { align-self: flex-start; background: #fff; border: 1px solid var(--cn-line); border-bottom-left-radius: 4px; }
.cnh-user { align-self: flex-end; background: var(--cn-navy); color: #fff; border-bottom-right-radius: 4px; }
.cnh-agent { align-self: flex-start; background: var(--cn-gold-soft); border: 1px solid #e8d9a8; border-left: 4px solid var(--cn-gold); border-bottom-left-radius: 4px; }
.cnh-agent .cnh-who { display: block; font-size: .75rem; font-weight: 700; color: #8a6d12; text-transform: uppercase; letter-spacing: .06em; margin-bottom: .15rem; }
.cnh-sys { align-self: center; max-width: 92%; text-align: center; font-size: .8rem; font-weight: 600; color: var(--cn-navy); background: var(--cn-gold-soft); border: 1px solid #ecdfae; border-radius: 999px; padding: .3rem .8rem; }
.cnh-typing { align-self: flex-start; display: inline-flex; gap: 4px; padding: .7rem .9rem; background: #fff; border: 1px solid var(--cn-line); border-radius: 14px; }
.cnh-typing i { width: 7px; height: 7px; border-radius: 50%; background: #94a3b8; animation: cnh-b 1s infinite; } .cnh-typing i:nth-child(2) { animation-delay: .15s; } .cnh-typing i:nth-child(3) { animation-delay: .3s; }
@keyframes cnh-b { 0%,80%,100% { opacity: .3; transform: none; } 40% { opacity: 1; transform: translateY(-3px); } }

.cnh-chips { display: flex; flex-wrap: wrap; gap: .4rem; padding: 0 1rem .6rem; background: var(--cn-bg); }
.cnh-chip { border: 1px solid var(--cn-navy); background: #fff; color: var(--cn-navy); border-radius: 999px; padding: .38rem .8rem; font: 600 .85rem/1.2 inherit; font-family: inherit; cursor: pointer; min-height: 36px; }
.cnh-chip:hover { background: var(--cn-navy); color: #fff; }
.cnh-chip--gold { border-color: var(--cn-gold); background: var(--cn-gold); color: var(--cn-navy); }

.cnh-form-wrap { align-self: stretch; background: #fff; border: 1px solid var(--cn-line); border-top: 3px solid var(--cn-gold); border-radius: 12px; padding: .85rem; }
.cnh-form-wrap h4 { margin: 0 0 .2rem; font-family: "Source Serif 4", Georgia, serif; color: var(--cn-navy); font-size: 1rem; }
.cnh-form-wrap .cnh-sub { margin: 0 0 .6rem; font-size: .83rem; color: #64748b; }
.cnh-form label { display: block; font-size: .8rem; font-weight: 600; color: var(--cn-navy); margin: .45rem 0 .15rem; }
.cnh-form input, .cnh-form select, .cnh-form textarea { width: 100%; font: inherit; font-size: 16px; padding: .5rem .6rem; border: 1px solid #cbd5e1; border-radius: 8px; background: #fff; color: var(--cn-text); }
.cnh-form textarea { resize: vertical; min-height: 56px; }
.cnh-row { display: grid; grid-template-columns: 1fr 1fr; gap: .5rem; }
.cnh-form .cnh-consent { font-weight: 400; color: #475569; }
.cnh-consent { display: flex; gap: .5rem; align-items: flex-start; margin: .6rem 0 .5rem; font-size: .76rem; color: #475569; line-height: 1.4; }
.cnh-consent input { width: 18px; height: 18px; margin-top: 2px; flex: none; accent-color: var(--cn-navy); }
.cnh-form .cnh-hp { position: absolute; left: -9999px; width: 1px; height: 1px; opacity: 0; }
.cnh-err { color: #b42318; font-size: .8rem; margin: .25rem 0; min-height: 1em; }
.cnh-btn { display: inline-flex; align-items: center; justify-content: center; width: 100%; min-height: 44px; border: 0; border-radius: 999px; background: var(--cn-navy); color: #fff; font: 700 .95rem/1 inherit; font-family: inherit; cursor: pointer; }
.cnh-btn:hover { background: var(--cn-navy-2); } .cnh-btn[disabled] { opacity: .6; cursor: wait; }
.cnh-link { background: none; border: 0; color: #64748b; font: inherit; font-size: .8rem; text-decoration: underline; cursor: pointer; margin-top: .4rem; }

.cnh-input { display: flex; gap: .5rem; align-items: flex-end; padding: .7rem .75rem; border-top: 1px solid var(--cn-line); background: #fff; }
.cnh-input textarea { flex: 1; resize: none; font: inherit; font-size: 16px; line-height: 1.35; max-height: 110px; min-height: 44px; padding: .6rem .75rem; border: 1px solid #cbd5e1; border-radius: 22px; color: var(--cn-text); }
.cnh-send { width: 44px; height: 44px; flex: none; border: 0; border-radius: 50%; background: var(--cn-gold); color: var(--cn-navy); cursor: pointer; display: inline-flex; align-items: center; justify-content: center; }
.cnh-send svg { width: 20px; height: 20px; } .cnh-send[disabled] { opacity: .5; cursor: default; }
.cnh-foot { padding: .35rem .9rem .55rem; font-size: .72rem; color: #64748b; background: #fff; text-align: center; }
.cnh-foot a { color: inherit; }
.cnh-sr { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* Mobile: the site's sticky Call / Text / Search Homes bar is ~76px tall below 768px. Stay above it. */
@media (max-width: 768px) {
  .cnh-launcher { right: 14px; bottom: calc(76px + 14px + env(safe-area-inset-bottom, 0px)); min-height: 50px; padding: .6rem .95rem .6rem .8rem; font-size: .9rem; }
  .cnh-panel { left: 8px; right: 8px; width: auto; max-width: none; top: calc(8px + env(safe-area-inset-top, 0px)); bottom: calc(76px + 8px + env(safe-area-inset-bottom, 0px)); height: auto; border-radius: 14px; }
}
@media (max-width: 380px) { .cnh-launcher .cnh-label-long { display: none; } .cnh-row { grid-template-columns: 1fr; } }
@media (prefers-reduced-motion: reduce) { .cnh-chat *, .cnh-launcher { animation: none !important; transition: none !important; } }
