/* Jerry's Home Remodeling · chat widget
   Designer · 26 Nov 2026 · DRAFT, review only. Not embedded on any live site.
   Branding source: https://jerryshandyman.netlify.app (CSS read Nov 26, 2026).
   Site tokens: --b #1e8bff, --bd #0a5fd6, --k #0a0a0f, --k2 #12141b, --y #ffd21f.
   Site type: Permanent Marker (logo, headings), Oswald 500/700 uppercase (buttons, labels), Inter 400/600 (body).
   Class prefix: jh-chat. */

.jh-chat{
  --jh-b:#1e8bff;--jh-bd:#0a5fd6;--jh-k:#0a0a0f;--jh-k2:#12141b;--jh-y:#ffd21f;
  --jh-card:#1a1d27;--jh-card2:#0e1016;--jh-line:#23314a;--jh-field:#181b24;--jh-edge:#68759A;
  --jh-mute:#aab;--jh-mute2:#99a;
  --jh-marker:'Permanent Marker',cursive;--jh-osw:Oswald,sans-serif;--jh-sans:Inter,system-ui,sans-serif;
  --jh-w:400px;--jh-bar:0px;
  --jh-shift:0px;
  position:fixed;right:20px;bottom:calc(20px + var(--jh-shift));z-index:2147483000;
  transition:bottom .2s ease;
  font:400 16px/1.5 var(--jh-sans);color:#fff;-webkit-text-size-adjust:100%;
}
.jh-chat:not(.is-ready){display:none}
.jh-chat *,.jh-chat *::before,.jh-chat *::after{box-sizing:border-box}
.jh-chat :where(button,textarea){font:inherit;color:inherit}
.jh-chat :where(p,h2){margin:0}
.jh-chat [hidden]{display:none!important}
.jh-chat__sr{position:absolute!important;width:1px;height:1px;overflow:hidden;clip:rect(0 0 0 0);white-space:nowrap}

/* focus: the site's own style, 3px yellow ring with a gap */
.jh-chat :is(button,a,textarea,.jh-chat__log):focus-visible{outline:3px solid var(--jh-y);outline-offset:3px}
.jh-chat__log:focus-visible{outline-offset:-5px}
.jh-chat__send:focus-visible,.jh-chat__retry:focus-visible{outline-color:#fff}

/* ---------- launcher: the site's .btn.bb + .pulse ---------- */
.jh-chat__launcher{
  position:relative;display:flex;align-items:center;gap:10px;margin-left:auto;
  min-height:58px;padding:14px 22px 14px 18px;border:0;border-radius:10px;cursor:pointer;
  background:var(--jh-bd);color:#fff;font:700 1.2rem/1 var(--jh-osw);text-transform:uppercase;
  box-shadow:0 8px 24px rgba(0,0,0,.55);transition:transform .2s,box-shadow .2s,background .2s,bottom .2s;
  animation:jh-pop-in .5s cubic-bezier(.2,.9,.3,1.2) both,jh-pulse 2s 1s infinite;
}
.jh-chat__launcher:hover,.jh-chat__launcher.is-hover{transform:translateY(-2px);box-shadow:0 12px 30px rgba(30,139,255,.45),0 8px 24px rgba(0,0,0,.55)}
.jh-chat__launcher:active{transform:translateY(0)}
.jh-chat__launcher-label{white-space:nowrap}
.jh-chat__ai{font:700 .8rem/1 var(--jh-osw);letter-spacing:.5px;padding:4px 7px;border-radius:5px;background:var(--jh-y);color:#000}
.jh-chat__ico{width:24px;height:24px;flex:none}
.jh-chat__ico--x{display:none}
.jh-chat.is-open .jh-chat__launcher{width:58px;padding:0;justify-content:center;animation:none}
.jh-chat.is-open .jh-chat__launcher-label,.jh-chat.is-open .jh-chat__ai,.jh-chat.is-open .jh-chat__ico--chat{display:none}
.jh-chat.is-open .jh-chat__ico--x{display:block}

/* ---------- panel: the site's card (dark gradient, #23314a border, 16px radius, 4px blue top bar) ---------- */
.jh-chat__panel{
  position:absolute;right:0;bottom:74px;width:min(var(--jh-w),calc(100vw - 40px));height:min(740px,calc(100dvh - 114px));
  display:flex;flex-direction:column;overflow:hidden;
  background:var(--jh-k);border:1px solid var(--jh-line);border-radius:16px;
  box-shadow:0 20px 60px rgba(0,0,0,.7),0 14px 34px rgba(30,139,255,.2);
}
.jh-chat__panel::before{content:"";flex:none;height:4px;background:var(--jh-b)}
.jh-chat.is-open .jh-chat__panel{animation:jh-rise .3s cubic-bezier(.2,.9,.3,1.1) both;transform-origin:100% 100%}

/* header: the site's sticky nav (dark, blue bottom rule, Permanent Marker logo) */
.jh-chat__head{flex:none;display:flex;align-items:center;gap:12px;padding:10px 8px 10px 16px;background:rgba(10,10,15,.96);border-bottom:2px solid var(--jh-b)}
.jh-chat__mark{width:40px;height:40px;flex:none}
.jh-chat__titles{min-width:0;flex:1}
.jh-chat__title{font:400 1.45rem/1.05 var(--jh-marker);color:var(--jh-b);white-space:normal}
.jh-chat__title span{color:#fff}
.jh-chat__sub{margin-top:2px;font:500 .85rem/1.2 var(--jh-osw);text-transform:uppercase;letter-spacing:.5px;color:var(--jh-mute)}
.jh-chat__x{flex:none;width:44px;height:44px;display:grid;place-items:center;border:0;border-radius:8px;background:transparent;color:#fff;cursor:pointer}
.jh-chat__x:hover{background:rgba(30,139,255,.25)}
.jh-chat__x svg{width:22px;height:22px}

/* thread */
.jh-chat__log{flex:1;min-height:0;overflow-y:auto;overscroll-behavior:contain;padding:18px 16px 8px;display:flex;flex-direction:column;gap:14px;background:var(--jh-k2);scrollbar-width:thin;scrollbar-color:var(--jh-line) transparent}
.jh-chat__empty{margin:auto;text-align:center;padding:12px 8px}
.jh-chat__empty-title{font:700 1.5rem/1.1 var(--jh-osw);text-transform:uppercase;letter-spacing:.5px;color:var(--jh-y)}
.jh-chat__empty p+p{margin-top:6px}
.jh-chat__empty-text{color:#bbc;font-size:15px}

/* privacy notice: first item in the thread (wording is Editor's, do not edit it here) */
.jh-chat__privacy{flex:none;display:flex;gap:10px;align-items:flex-start;padding:12px 14px;border-radius:12px;border:1px solid var(--jh-edge);border-left:4px solid var(--jh-b);background:var(--jh-card);color:#E8EDF8;font-size:13.5px;line-height:1.5}
.jh-chat__privacy svg{flex:none;width:20px;height:20px;margin-top:1px;color:var(--jh-b)}
.jh-chat__privacy-link{display:inline-flex;align-items:center;min-height:44px;font-weight:700;color:var(--jh-y);text-underline-offset:3px}

.jh-chat__msg{display:flex;flex-direction:column;gap:5px;max-width:88%;animation:jh-msg .26s ease-out both}
.jh-chat__msg--user{align-self:flex-end;align-items:flex-end}
.jh-chat__msg--agent{align-self:flex-start}
.jh-chat__who{font:500 .8rem/1 var(--jh-osw);text-transform:uppercase;letter-spacing:.5px;color:var(--jh-mute)}
.jh-chat__bubble{padding:11px 15px;border-radius:16px;font-size:15px;line-height:1.5;overflow-wrap:anywhere}
.jh-chat__bubble>*+*{margin-top:.7em}
.jh-chat__bubble ul,.jh-chat__bubble ol{margin:0;padding-left:1.25em}
.jh-chat__bubble a{color:var(--jh-y);font-weight:600;text-underline-offset:3px}
.jh-chat__bubble code{font:600 .9em ui-monospace,Menlo,monospace;background:rgba(255,255,255,.1);padding:1px 5px;border-radius:4px}
.jh-chat__msg--agent .jh-chat__bubble{background:linear-gradient(160deg,var(--jh-card),var(--jh-card2));border:1px solid var(--jh-line);border-top-left-radius:4px;color:#fff}
.jh-chat__msg--user .jh-chat__bubble{background:var(--jh-bd);color:#fff;border-top-right-radius:4px}
.jh-chat__msg--user .jh-chat__bubble a{color:#fff}
.jh-chat__example{align-self:center;font:500 .85rem/1.3 var(--jh-osw);text-transform:uppercase;letter-spacing:.5px;color:var(--jh-mute);padding:6px 12px;border:2px dashed var(--jh-line);border-radius:30px;text-align:center}
.jh-chat__typing .jh-chat__bubble{display:flex;gap:6px;align-items:center;min-height:42px}
.jh-chat__dot{width:8px;height:8px;border-radius:50%;background:var(--jh-y);animation:jh-dot 1.1s ease-in-out infinite}
.jh-chat__dot:nth-of-type(2){animation-delay:.15s}.jh-chat__dot:nth-of-type(3){animation-delay:.3s}
.jh-chat__msg.is-streaming .jh-chat__bubble::after{content:"";display:inline-block;width:7px;height:1em;margin-left:3px;vertical-align:-2px;background:var(--jh-y);animation:jh-caret .9s steps(2) infinite}
.jh-chat__note{align-self:stretch;padding:12px 14px;border:2px solid var(--jh-y);border-radius:12px;background:#0e1016;font-size:14px}
.jh-chat__retry{margin-top:10px;min-height:44px;padding:0 18px;border:0;border-radius:10px;background:var(--jh-y);color:#000;font:700 1.05rem/1 var(--jh-osw);text-transform:uppercase;cursor:pointer}

/* composer: the site's form fields (#181b24, #2c3446 edge) and yellow .by button */
.jh-chat__form{flex:none;display:flex;gap:10px;align-items:flex-end;padding:12px;background:#0e1016;border-top:1px solid var(--jh-line)}
.jh-chat__input{flex:1;min-width:0;min-height:48px;max-height:120px;resize:none;padding:12px 13px;border-radius:8px;border:2px solid var(--jh-edge);background:var(--jh-field);color:#fff;font-size:16px;line-height:1.4}
.jh-chat__input::placeholder{color:var(--jh-mute);opacity:1}
.jh-chat__input:hover{border-color:#8a96b4}
.jh-chat__input:focus{border-color:var(--jh-b)}
.jh-chat__input:focus-visible{outline:2px solid var(--jh-b);outline-offset:0}
.jh-chat__send{flex:none;min-width:88px;min-height:48px;padding:0 20px;border:0;border-radius:10px;background:var(--jh-y);color:#000;cursor:pointer;font:700 1.2rem/1 var(--jh-osw);text-transform:uppercase;transition:transform .2s,background .2s}
.jh-chat__send:hover:not(:disabled){transform:translateY(-2px);background:#ffdf5c}
.jh-chat__send:disabled{background:#2c3446;color:#aab;cursor:not-allowed}

/* footer contact: number and links come from the site (nav, hero, mobile bar, quote section) */
.jh-chat__foot{flex:none;display:flex;flex-wrap:wrap;align-items:center;justify-content:space-between;gap:6px 12px;padding:2px 12px calc(10px + env(safe-area-inset-bottom));background:#0e1016}
.jh-chat__foot p{font-size:.85rem;color:var(--jh-mute2)}
.jh-chat__foot-links{display:flex;gap:8px}
.jh-chat__foot a{display:inline-flex;align-items:center;justify-content:center;min-height:44px;min-width:64px;padding:0 14px;border:2px solid var(--jh-b);border-radius:8px;color:#fff;text-decoration:none;font:500 1rem/1 var(--jh-osw);text-transform:uppercase}
.jh-chat__foot a:hover{background:var(--jh-bd)}

html.jh-chat-lock{overflow:hidden}
/* the site shows a fixed Call / Text bar (about 59–60px) at 600px and below: keep the launcher above it */
@media (max-width:600px){
  .jh-chat{--jh-bar:60px;right:16px;bottom:calc(16px + var(--jh-bar) + env(safe-area-inset-bottom) + var(--jh-shift))}
  .jh-chat__panel{position:fixed;inset:0;width:100%;height:100dvh;bottom:auto;right:auto;border:0;border-radius:0;box-shadow:none}
  .jh-chat.is-open .jh-chat__launcher{display:none}
  .jh-chat__head{padding-top:max(10px,env(safe-area-inset-top))}
  .jh-chat__title{font-size:1.3rem}
  .jh-chat__msg{max-width:92%}
}

/* icon-only circle under 480px so the 191px "Chat Now AI" pill cannot cover the quote submit */
@media (max-width:480px){
  .jh-chat__launcher{width:58px;height:58px;min-height:58px;padding:0;justify-content:center;gap:0;border-radius:50%}
  .jh-chat__launcher-label,.jh-chat__ai{display:none}
  .jh-chat__ico--chat{display:block}
}

/* tucked away when the quote submit / helper would still be covered after raising */
.jh-chat.is-tucked:not(.is-open) .jh-chat__launcher{opacity:0;visibility:hidden;pointer-events:none}

@keyframes jh-pop-in{from{opacity:0;transform:translateY(22px) scale(.92)}to{opacity:1;transform:none}}
@keyframes jh-pulse{0%{box-shadow:0 8px 24px rgba(0,0,0,.55),0 0 0 0 #1e8bffaa}70%{box-shadow:0 8px 24px rgba(0,0,0,.55),0 0 0 18px #1e8bff00}100%{box-shadow:0 8px 24px rgba(0,0,0,.55),0 0 0 0 #1e8bff00}}
@keyframes jh-rise{from{opacity:0;transform:translateY(16px) scale(.96)}to{opacity:1;transform:none}}
@keyframes jh-msg{from{opacity:0;transform:translateY(6px)}to{opacity:1;transform:none}}
@keyframes jh-dot{0%,80%,100%{transform:translateY(0);opacity:.5}40%{transform:translateY(-4px);opacity:1}}
@keyframes jh-caret{50%{opacity:0}}
@media (prefers-reduced-motion:reduce){
  .jh-chat *,.jh-chat *::before,.jh-chat *::after{animation:none!important;transition:none!important}
  .jh-chat__launcher:hover,.jh-chat__launcher.is-hover,.jh-chat__send:hover:not(:disabled){transform:none}
  .jh-chat__dot{opacity:1}
}
@media (forced-colors:active){
  .jh-chat__launcher,.jh-chat__send,.jh-chat__retry{border:2px solid ButtonText}
  .jh-chat__panel{border:2px solid CanvasText}
  .jh-chat__privacy{border:2px solid CanvasText;border-left-width:4px}
}


/* Preview desktop fix (after c9f8cccc review): keep the open panel below the
   sticky site header, cap its height, and stop a dark gap / clipped notice.
   Mobile (max-width:600px) fullscreen rules above are unchanged. */
@media (min-width:601px){
  .jh-chat__panel{
    position:fixed;
    right:20px;
    bottom:calc(20px + 58px + 16px + var(--jh-shift, 0px));
    top:auto;
    height:auto;
    max-height:calc(100dvh - var(--jh-header, 64px) - 12px - 20px - 58px - 16px);
    justify-content:flex-start;
  }
  .jh-chat.is-open .jh-chat__panel{
    animation:jh-rise-desktop .25s ease-out both;
    transform-origin:100% 100%;
  }
  .jh-chat__log{justify-content:flex-start}
  .jh-chat__empty{margin:16px 0 0}
}
@keyframes jh-rise-desktop{from{opacity:0;transform:translateY(8px)}to{opacity:1;transform:none}}

/* The panel is a <section>, and the site sets section{padding:90px 0} (64px on small screens).
   That padding was the empty dark band above the chat header and clipped the terms notice. */
.jh-chat__panel{padding:0;margin:0}
