/* "Chat with Shoobook" on the static portfolio demos (see shoobook-chat.js). Every rule is scoped to .sbchat so the
   demo's theme is untouched; theme rules on bare elements use :where() (zero specificity), so these win.
   Layout:
   - Launcher: bottom-right. <=781px it sits above the theme's fixed Call/Book bar (--sb-sticky-h, 4.25rem, plus the
     bottom safe area) and hides while the mobile menu is open or a page form field has focus. >=1408px the Back to
     Shoobook pill/tile is fixed in the LEFT gutter, so the right corner is free.
   - Panel: <=781px a full-screen dialog sized to the visual viewport by the script (keyboard-aware, safe areas);
     wider, a floating 392px card above the launcher that never reaches under the sticky header. */
.sbchat,.sbchat *,.sbchat *::before,.sbchat *::after{box-sizing:border-box}
.sbchat{--sbc-navy:#0a1128;--sbc-navy-2:#17233c;--sbc-accent:#f2a33a;--sbc-text:#0a1128;--sbc-muted:#5b6475;--sbc-border:#d9dee7;--sbc-surface:#f6f7f9;--sbc-error:#b42318;font:400 15px/1.45 system-ui,-apple-system,"Segoe UI",Roboto,sans-serif;color:var(--sbc-text);letter-spacing:normal;text-transform:none}
.sbchat [hidden]{display:none!important}
.sbchat button{font:inherit;letter-spacing:normal;text-transform:none;margin:0;cursor:pointer}
.sbchat button:focus-visible,.sbchat summary:focus-visible,.sbchat a:focus-visible,.sbchat .sbchat-field:focus-visible,.sbchat .sbchat-input:focus-visible,.sbchat-panel:focus-visible{outline:2px solid #38bdf8;outline-offset:2px}
.sbchat-panel:focus{outline:none}
.sbchat-sr{position:absolute!important;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0,0,0,0);white-space:nowrap;border:0}

.sbchat-launcher{position:fixed;z-index:210;right:calc(24px + env(safe-area-inset-right,0px));bottom:calc(24px + env(safe-area-inset-bottom,0px));display:inline-flex;align-items:center;gap:.5rem;min-height:48px;padding:.5rem 1.1rem .5rem .6rem;border:1px solid #94a3b8;border-radius:999px;background:#f1f5f9;color:var(--sbc-navy);font-weight:650;font-size:15px;line-height:1.2;box-shadow:0 8px 24px rgba(10,17,40,.28);white-space:nowrap}
.sbchat-launcher:hover{background:#e2e8f0}
.sbchat .sbchat-launcher:focus-visible{outline-color:var(--sbc-navy);box-shadow:0 0 0 6px #fff,0 8px 24px rgba(10,17,40,.28)}
.sbchat-launcher__mark{width:28px;height:auto;flex:none;max-width:none}

.sbchat-panel{position:fixed;z-index:211;right:calc(24px + env(safe-area-inset-right,0px));bottom:calc(84px + env(safe-area-inset-bottom,0px));display:flex;flex-direction:column;width:min(392px,calc(100vw - 32px));height:min(600px,calc(100dvh - 84px - var(--sbdemo-head-h,80px) - 16px));min-height:280px;overflow:hidden;border:1px solid var(--sbc-border);border-radius:18px;background:#fff;box-shadow:0 18px 50px rgba(10,17,40,.25)}
.sbchat-head{display:flex;align-items:center;gap:.75rem;flex:none;padding:.75rem;background:#f1f5f9;color:var(--sbc-navy)}
.sbchat-logo{width:40px;height:auto;flex:none;max-width:none}
.sbchat-titles{min-width:0;flex:1}
.sbchat .sbchat-title{margin:0;padding:0;font:650 16px/1.25 system-ui,-apple-system,"Segoe UI",Roboto,sans-serif;color:var(--sbc-navy);letter-spacing:normal;text-transform:none;text-wrap:initial;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.sbchat .sbchat-status{margin:0;font-size:12px;line-height:1.35;color:#334155;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.sbchat .sbchat-close{display:grid;place-items:center;flex:none;width:44px;height:44px;padding:0;border:0;border-radius:50%;background:transparent;color:var(--sbc-navy)}
.sbchat .sbchat-close:hover{background:rgba(10,17,40,.08)}
.sbchat .sbchat-head .sbchat-close:focus-visible{outline-color:var(--sbc-navy)}

.sbchat-history{min-height:0;flex:1;overflow-y:auto;overscroll-behavior:contain;padding:.75rem .75rem 1rem}
.sbchat .sbchat-notice{margin:0 0 .75rem;padding:.55rem .7rem;border-radius:10px;background:#eef2ff;color:#1e2a4a;font-size:12.5px;line-height:1.4}
.sbchat .sbchat-list{display:flex;flex-direction:column;gap:.6rem;margin:0;padding:0;list-style:none}
.sbchat .sbchat-list>li{margin:0;padding:0}
.sbchat-msg{display:flex;flex-direction:column;align-items:flex-start}
.sbchat-msg--mine{align-items:flex-end}
.sbchat-bubble{max-width:85%;padding:.5rem .85rem;border-radius:16px 16px 16px 6px;border:1px solid var(--sbc-border);background:var(--sbc-surface);color:var(--sbc-text);white-space:pre-wrap;overflow-wrap:anywhere;font-size:15px;line-height:1.5}
.sbchat-msg--mine .sbchat-bubble{border-color:var(--sbc-navy);border-radius:16px 16px 6px 16px;background:var(--sbc-navy);color:#fff}
.sbchat-msg--pending .sbchat-bubble{opacity:.65}
.sbchat-bubble a{color:inherit;text-decoration:underline;text-underline-offset:2px}
.sbchat .sbchat-file{display:block;margin-top:.35rem;font-size:13px}
.sbchat-meta{margin-top:.2rem;padding:0 .25rem;font-size:11px;color:var(--sbc-muted)}
.sbchat-meta--error{display:flex;align-items:center;gap:.5rem;color:var(--sbc-error)}
.sbchat .sbchat-retry{min-height:44px;padding:0 .9rem;border:1px solid rgba(180,35,24,.4);border-radius:999px;background:#fff;color:var(--sbc-error);font-weight:600;font-size:12px}
.sbchat .sbchat-loading{padding:1.5rem 0;text-align:center;color:var(--sbc-muted);font-size:14px}
.sbchat .sbchat-typing,.sbchat .sbchat-ended{margin:.75rem 0 0;font-size:12.5px;color:var(--sbc-muted)}
.sbchat .sbchat-ended{padding:.6rem .7rem;border:1px solid var(--sbc-border);border-radius:10px;text-align:center}

.sbchat-identity{margin-top:1rem;padding:.85rem;border:1px solid var(--sbc-border);border-radius:16px;background:var(--sbc-surface)}
.sbchat-identity>p{margin:0 0 .6rem;font-size:14px}
.sbchat .sbchat-label{display:block;margin:0 0 .6rem;font-size:14px;font-weight:600;color:var(--sbc-text)}
.sbchat .sbchat-optional{font-weight:400;color:var(--sbc-muted)}
.sbchat .sbchat-field{display:block;width:100%;height:44px;margin:.25rem 0 0;padding:0 .75rem;border:1px solid #b9c1ce;border-radius:12px;background:#fff;color:var(--sbc-text);font:400 16px/1.2 system-ui,-apple-system,"Segoe UI",Roboto,sans-serif;box-shadow:none}
.sbchat .sbchat-primary{display:block;width:100%;height:44px;margin-top:.25rem;border:0;border-radius:12px;background:var(--sbc-navy);color:#fff;font-weight:650;font-size:14px}
.sbchat .sbchat-small{margin:.6rem 0 0;font-size:12px;color:var(--sbc-muted)}
.sbchat .sbchat-error{margin:0 0 .5rem;font-size:13px;color:var(--sbc-error)}
.sbchat .sbchat-error--box{padding:.5rem .75rem;border-radius:12px;background:#fdecea}
.sbchat-quick{display:flex;flex-wrap:wrap;gap:.5rem;margin-top:.75rem}
.sbchat .sbchat-chip{min-height:36px;padding:.3rem .8rem;border:1px solid var(--sbc-border);border-radius:999px;background:#fff;color:var(--sbc-text);font-size:14px;line-height:1.2}
.sbchat .sbchat-chip:hover{border-color:var(--sbc-accent)}

.sbchat-composer{flex:none;position:relative;padding:.5rem .75rem max(.5rem,env(safe-area-inset-bottom,0px));border-top:1px solid var(--sbc-border);background:#fff}
.sbchat--keyboard .sbchat-composer{padding-bottom:.5rem}
.sbchat-row{display:flex;align-items:flex-end;gap:.5rem}
.sbchat .sbchat-input{flex:1;min-width:0;min-height:44px;max-height:128px;margin:0;padding:.6rem .85rem;border:1px solid #b9c1ce;border-radius:18px;background:var(--sbc-surface);color:var(--sbc-text);font:400 16px/1.35 system-ui,-apple-system,"Segoe UI",Roboto,sans-serif;resize:none;box-shadow:none}
.sbchat .sbchat-send{display:grid;place-items:center;flex:none;width:44px;height:44px;padding:0;border:0;border-radius:50%;background:var(--sbc-accent);color:var(--sbc-navy)}
.sbchat .sbchat-send:disabled{opacity:.6}
.sbchat-hp{position:absolute;left:-9999px;width:1px;height:1px;overflow:hidden}

@media (min-width:782px){.sbchat .sbchat-input{font-size:15px}}
@media (max-width:781px){
  .sbchat-launcher{right:calc(12px + env(safe-area-inset-right,0px));bottom:calc(16px + env(safe-area-inset-bottom,0px));min-height:46px;font-size:14px;padding:.45rem 1rem .45rem .5rem}
  body.has-shoobook-sticky-bar .sbchat-launcher{bottom:calc(var(--sb-sticky-h,4.25rem) + env(safe-area-inset-bottom,0px) + 12px)}
  /* The open mobile menu covers the page (and hides the Call/Book bar); a page field with focus has the keyboard. */
  html.has-modal-open .sbchat-launcher,
  body:has(.wp-block-navigation__responsive-container.is-menu-open) .sbchat-launcher,
  .sbchat--page-field .sbchat-launcher,
  .sbchat--open .sbchat-launcher{display:none}
  .sbchat-panel{z-index:99999;top:0;right:0;bottom:auto;left:0;width:100%;height:100dvh;min-height:0;border:0;border-radius:0;box-shadow:none}
  .sbchat-head{padding-top:calc(.75rem + env(safe-area-inset-top,0px));padding-left:calc(.75rem + env(safe-area-inset-left,0px));padding-right:calc(.75rem + env(safe-area-inset-right,0px))}
  .sbchat-composer{padding-left:calc(.75rem + env(safe-area-inset-left,0px));padding-right:calc(.75rem + env(safe-area-inset-right,0px))}
}
@media (prefers-reduced-motion:reduce){.sbchat *{transition:none!important;animation:none!important}}
@media print{.sbchat{display:none!important}}
/* Day separators, lifecycle (End / ended / Start a new conversation), earlier conversations. Same tokens as above. */
.sbchat .sbchat-day{display:flex;align-items:center;gap:.6rem;list-style:none;margin:.25rem 0;font-size:11px;font-weight:600;color:var(--sbc-muted)}
.sbchat .sbchat-day::before,.sbchat .sbchat-day::after{content:"";flex:1;height:1px;background:var(--sbc-border)}
.sbchat .sbchat-link-btn{min-height:44px;padding:0 .9rem;border:1px solid var(--sbc-border);border-radius:999px;background:#fff;color:var(--sbc-text);font-weight:600;font-size:12.5px;line-height:1.2}
.sbchat .sbchat-link-btn:hover{border-color:var(--sbc-accent)}
.sbchat .sbchat-older{display:block;margin:0 auto .6rem}
.sbchat .sbchat-endrow{margin:.75rem 0 0;text-align:center}
.sbchat .sbchat-endrow .sbchat-link-btn{border-color:transparent;text-decoration:underline;text-underline-offset:2px;color:var(--sbc-muted);font-weight:500}
.sbchat .sbchat-ended p{margin:.2rem 0}
.sbchat .sbchat-ended__title{font-size:14px;font-weight:600;color:var(--sbc-text)}
.sbchat .sbchat-btnrow{display:flex;flex-wrap:wrap;justify-content:center;gap:.5rem;margin-top:.5rem}
.sbchat .sbchat-primary--inline{display:inline-block;width:auto;padding:0 1rem;margin-top:.5rem}
.sbchat .sbchat-btnrow .sbchat-primary--inline{margin-top:0}
.sbchat .sbchat-earlier{margin:.75rem 0 0;padding:.4rem .7rem;border:1px solid var(--sbc-border);border-radius:10px;font-size:12.5px;color:var(--sbc-muted)}
.sbchat .sbchat-earlier summary{min-height:44px;display:flex;align-items:center;cursor:pointer;font-weight:600;font-size:14px;color:var(--sbc-text)}
.sbchat .sbchat-earlier ul{margin:0;padding:0;list-style:none}
.sbchat .sbchat-earlier-item{display:flex;align-items:center;justify-content:space-between;gap:.5rem;margin:.25rem 0}
.sbchat .sbchat-view .sbchat-link-btn{margin:0 0 .5rem}
.sbchat [hidden]{display:none!important}
