/* AI chat bubble on a property's website (resources/views/sites/partials/ai-chat.blade.php + public/js/sites/ai-chat.js),
   from the approved mockup tmp-hu-mock-aichat (chat-widget.css, 2026-11-19). Colours come from the property's own
   theme vars (--primary, --accent, --ink, --soft, --soft-2, --line, --text, --on-accent); the fallbacks are Sunburst's. */
.hu-chat,.hu-chat *{box-sizing:border-box}
.hu-chat{-webkit-text-size-adjust:100%;text-size-adjust:100%}
.hu-chat [hidden]{display:none!important}
.hu-chat-launcher{position:fixed;right:28px;bottom:28px;z-index:9999;display:flex;align-items:center;gap:12px;
  background:var(--primary,#2F5D57);color:#fff;border:0;border-radius:999px;padding:10px 22px 10px 10px;margin:0;
  box-shadow:0 10px 30px rgba(20,40,36,.28),0 2px 6px rgba(20,40,36,.18);font-family:inherit;font-size:15px;font-weight:700;line-height:1.2;text-align:left;letter-spacing:.01em;cursor:pointer;text-transform:none}
.hu-chat-launcher .ic{width:42px;height:42px;border-radius:50%;background:var(--accent,#E8A33D);display:grid;place-items:center;flex:none}
.hu-chat-launcher .ic svg{width:22px;height:22px;fill:none;stroke:var(--ink,#1E2B28);stroke-width:2;stroke-linecap:round;stroke-linejoin:round}
.hu-chat-launcher .t small{display:block;font-weight:400;font-size:12px;opacity:.82;margin-top:2px}
.hu-chat-launcher .ic-x{display:none}
.hu-chat-launcher.round{padding:0;width:62px;height:62px;justify-content:center;background:var(--accent,#E8A33D)}
.hu-chat-launcher.round .t,.hu-chat-launcher.round .ic-chat{display:none}
.hu-chat-launcher.round .ic-x{display:block}
.hu-chat-launcher.round .ic{background:transparent;width:62px;height:62px}
.hu-chat-launcher.round .ic svg{width:28px;height:28px}
.hu-chat-launcher:focus-visible,.hu-chat-panel button:focus-visible{outline:3px solid var(--accent,#E8A33D);outline-offset:2px}

.hu-chat-panel{position:fixed;right:28px;bottom:104px;z-index:9999;width:392px;max-width:calc(100vw - 16px);height:676px;max-height:calc(100vh - 128px);max-height:calc(100dvh - 128px);
  background:#fff;border-radius:18px;overflow:hidden;display:flex;flex-direction:column;text-align:left;
  box-shadow:0 24px 60px rgba(20,40,36,.30),0 4px 14px rgba(20,40,36,.16);font-family:inherit;color:var(--ink,#1E2B28);line-height:1.42}
.hu-chat-head{background:var(--primary,#2F5D57);color:#fff;padding:16px 16px 14px 18px;display:flex;align-items:center;gap:12px}
.hu-chat-head .av{width:40px;height:40px;border-radius:50%;background:#fff;overflow:hidden;flex:none;display:grid;place-items:center;color:var(--primary,#2F5D57);font-weight:700}
.hu-chat-head .av img{width:36px;height:36px;object-fit:contain}
.hu-chat-head .nm{flex:1;min-width:0}
.hu-chat-head .nm b{display:block;font-size:16px;line-height:1.25;color:#fff}
.hu-chat-head .nm span{display:flex;align-items:center;gap:6px;font-size:12px;opacity:.85;margin-top:2px}
.hu-chat-head .nm span i{width:7px;height:7px;border-radius:50%;background:#7BD88F;display:inline-block}
.hu-chat-head .x{width:30px;height:30px;border-radius:50%;display:grid;place-items:center;opacity:.85;background:transparent;border:0;padding:0;cursor:pointer}
.hu-chat-head .x:hover{opacity:1;background:rgba(255,255,255,.12)}
.hu-chat-head .x svg{width:18px;height:18px;stroke:#fff;stroke-width:2;fill:none;stroke-linecap:round}
.hu-chat-body{flex:1;overflow-y:auto;padding:12px 16px 6px;display:flex;flex-direction:column;gap:8px;background:#fff}
.hu-chat-body>:first-child{margin-top:auto}
.hu-msg{max-width:86%;font-size:13.5px;line-height:1.42;padding:8px 13px;border-radius:14px;white-space:pre-wrap;word-wrap:break-word;overflow-wrap:anywhere;min-width:0}
.hu-msg.bot{align-self:flex-start;background:var(--soft,#F6F1E7);border-bottom-left-radius:4px;color:var(--ink,#1E2B28)}
.hu-msg.me{align-self:flex-end;background:var(--primary,#2F5D57);color:#fff;border-bottom-right-radius:4px}
.hu-msg.typing{opacity:.7;font-style:italic}
.hu-chips{display:flex;gap:6px;flex-wrap:wrap;align-self:flex-start}
.hu-chips a{font-size:12px;font-weight:600;border:1.5px solid var(--primary,#2F5D57);color:var(--primary,#2F5D57);border-radius:999px;padding:5px 11px;text-decoration:none;background:#fff;line-height:1.3}
.hu-chips a.acc{background:var(--accent,#E8A33D);border-color:var(--accent,#E8A33D);color:var(--on-accent,#1E2B28)}
.hu-chat-input{border-top:1px solid var(--line,#E6DDCB);padding:10px 12px 8px;background:#fff;margin:0}
.hu-chat-input .row{display:flex;align-items:center;gap:8px;border:1.5px solid var(--line,#E6DDCB);border-radius:999px;padding:6px 6px 6px 16px}
.hu-chat-input .row:focus-within{border-color:var(--primary,#2F5D57);box-shadow:0 0 0 3px rgba(47,93,87,.18)}
/* The theme's own input / :focus styles (square border, blue ring) must not show inside the rounded field: its focus
   style is the .row's above. */
.hu-chat .hu-chat-input input,.hu-chat .hu-chat-input input:focus,.hu-chat .hu-chat-input input:focus-visible{flex:1;min-width:0;font:inherit;font-size:13.5px;color:var(--ink,#1E2B28);
  border:0!important;outline:0!important;box-shadow:none!important;background:transparent!important;border-radius:0;padding:0;margin:0;height:24px;-webkit-appearance:none;appearance:none}
.hu-chat-input input::placeholder{color:#8A938F}
.hu-chat-input .send{width:34px;height:34px;border-radius:50%;background:var(--accent,#E8A33D);display:grid;place-items:center;border:0;padding:0;cursor:pointer;flex:none}
.hu-chat-input .send[disabled]{opacity:.5;cursor:default}
.hu-chat-input .send svg{width:16px;height:16px;stroke:var(--ink,#1E2B28);stroke-width:2.2;fill:none;stroke-linecap:round;stroke-linejoin:round}
.hu-chat-input .pw{text-align:center;font-size:10.5px;color:#9AA29E;margin-top:7px;letter-spacing:.02em;white-space:nowrap}
/* Round 11 (Nathan 2026-11-21): "Terms & Privacy" next to "Powered by HelloUnits", in the same small grey (was round
   10's notice line under the field). The theme's own link styles must not reach it. */
.hu-chat .hu-chat-input .pw .tos a{color:#9AA29E;font:inherit;letter-spacing:inherit;text-transform:none;text-decoration:underline;text-underline-offset:2px;font-weight:400}
.hu-chat .hu-chat-input .pw .tos a:hover,.hu-chat .hu-chat-input .pw .tos a:focus-visible{color:#6F7874}
.hu-chat-input .pw b{color:#6F7874;font-weight:600}
/* Phones (Nathan 2026-11-20, iPhone): iOS Safari zooms the whole page in when a field under 16px is focused, and the
   panel focuses its field on open, so tapping the bubble zoomed the page and pushed the panel and Send off-screen.
   The field is 16px here (no maximum-scale / user-scalable=no on the viewport: pinch zoom stays). The panel spans the
   screen less 8px a side and its height fits the visible viewport (dvh, with a vh fallback for older browsers). */
/* Round 8 (Nathan 2026-11-21, phone): the open panel covered the whole screen once the field was tapped, hiding the
   site's logo, and the intro text was too small. On phones the open panel is now a bottom sheet at most 75% of the
   VISIBLE viewport tall: ai-chat.js sets --hu-vvh (visualViewport height) and --hu-kb (how much of the layout viewport
   the on-screen keyboard covers), so with the keyboard up the sheet sits just above it and shrinks instead of pushing
   the logo off. The round launcher (X) is hidden while open; the panel's own minimise button closes it. Bubbles 16px. */
@media (max-width:480px){
  .hu-chat-launcher{right:16px;bottom:16px}
  .hu-chat-launcher.round{display:none}
  .hu-chat-panel{right:8px;left:8px;width:auto;max-width:none;bottom:12px;bottom:calc(var(--hu-kb,0px) + 12px);
    height:75vh;height:min(676px,max(calc(var(--hu-vvh,100vh) * .75),min(230px,calc(var(--hu-vvh,100vh) - 24px))));max-height:none}
  .hu-chat-head .x{width:40px;height:40px}
  /* Keyboard up (ai-chat.js adds .kb): the sheet is short, so "Powered by" steps aside and the floor of 230px (never
     taller than the visible area) keeps the field and Send inside the sheet. Round 11 fix (hu-r11d-kb-terms): the
     Terms & Privacy link stays (setOpen focuses the field, so on phones .kb is on from the moment the chat opens);
     only "Powered by HelloUnits" (.by) and the dot go, on one small tight line. No terms link: the whole footer goes. */
  .hu-chat-panel.kb .hu-chat-input .pw .by,.hu-chat-panel.kb .hu-chat-input .pw .dot,.hu-chat-panel.kb .hu-chat-input .pw.no-tos{display:none}
  .hu-chat-panel.kb .hu-chat-input .pw{margin-top:3px;line-height:1.2}
  .hu-chat-panel.kb .hu-chat-head{padding:8px 10px 8px 14px}
  .hu-chat-panel.kb .hu-chat-input{padding:8px 10px}
  .hu-chat .hu-chat-input input,.hu-chat .hu-chat-input input:focus,.hu-chat .hu-chat-input input:focus-visible{font-size:16px;height:26px}
  .hu-chat-head{padding:12px 12px 10px 14px}
  .hu-chat-body{padding:12px 12px 6px}
  .hu-msg{font-size:16px;line-height:1.5;padding:10px 14px;max-width:90%}
  .hu-chips a{font-size:14px;padding:6px 12px}
  .hu-chat-input .pw{margin-top:4px}
}
/* Any touch screen wider than 480px (a phone in landscape, an iPad) gets the same auto-focus zoom, so the 16px field
   applies there too; desktop mouse users keep 13.5px. */
@media (pointer:coarse){
  .hu-chat .hu-chat-input input,.hu-chat .hu-chat-input input:focus,.hu-chat .hu-chat-input input:focus-visible{font-size:16px;height:26px}
}
