/* Chat plate and chat window. Static design component, no LiveChat script.
   To use on any page, add these two lines to <head>:
     <link rel="stylesheet" href="assets/new/chat-widget.css">
     <script src="assets/new/chat-widget.js" defer></script>
   Page fonts are inherited by name, the fallback keeps it readable without them.
   Any link or button with data-chat-open opens the chat too: data-chat-msg is the draft, data-chat-how and data-chat-why go to
   Umami chat_open; the link's href (/contact-us/#message) is the way without scripts. */

.bm-chat-plate { position: fixed; right: calc(24px + env(safe-area-inset-right)); bottom: calc(24px + env(safe-area-inset-bottom)); z-index: 70; display: flex; align-items: center; gap: 12px; padding: 10px 18px 10px 10px; background: #0A0E14; color: #fff; border: 0; border-radius: 0; cursor: pointer; text-align: left; font-family: 'Funnel Sans', system-ui, sans-serif; box-shadow: 0 20px 40px -10px rgba(10,14,20,.4); transition: background-color .2s, transform .2s; }
.bm-chat-plate:hover { transform: translateY(-2px); }
.bm-chat-plate:focus-visible { outline: 2px solid #B43335; outline-offset: 2px; }
.bm-chat-ico { flex: 0 0 auto; width: 32px; height: 32px; display: flex; align-items: center; justify-content: center; background: #B43335; }
.bm-chat-ico svg { width: 18px; height: 18px; display: block; }
.bm-chat-copy { display: block; font-size: 13px; line-height: 1.3; }
.bm-chat-label { display: block; color: rgba(255,255,255,.55); font-size: 11px; }
.bm-chat-value { display: block; color: #fff; font-weight: 500; white-space: nowrap; }
.bm-chat-open .bm-chat-plate { visibility: hidden; }
/* A chat button clicked while LiveChat is still loading waits up to 6 s (chat-widget.js): the pointer says so. */
html.bm-chat-wait, html.bm-chat-wait * { cursor: progress !important; }
/* Phone: out of the way while a pay button is under it (chat-widget.js); the help box under the order keeps "chat with us". */
.bm-chat-plate.is-tucked { opacity: 0; visibility: hidden; pointer-events: none; transition: opacity .15s, visibility .15s; }

.bm-chat-window { position: fixed; right: calc(24px + env(safe-area-inset-right)); bottom: calc(24px + env(safe-area-inset-bottom)); z-index: 100; display: none; flex-direction: column; width: 380px; height: min(560px, calc(100vh - 48px)); background: #fff; color: #0A0E14; border: 1px solid #E5E5E0; font-family: 'Funnel Sans', system-ui, sans-serif; font-size: 14px; line-height: 20px; box-shadow: 0 24px 60px -16px rgba(10,14,20,.45); }
.bm-chat-open .bm-chat-window { display: flex; }

.bm-chat-head { position: relative; display: flex; align-items: center; gap: 12px; padding: 16px; background: #0A0E14; color: #fff; }
.bm-chat-head::before { content: ''; position: absolute; left: 0; right: 0; top: 0; height: 4px; background: #B43335; }
.bm-chat-head img { width: 40px; height: 40px; flex: 0 0 auto; }
.bm-chat-title { display: block; font-family: 'Funnel Display', system-ui, sans-serif; font-weight: 600; font-size: 18px; line-height: 1.2; letter-spacing: -0.02em; }
.bm-chat-hours { display: block; margin-top: 3px; font-family: 'JetBrains Mono', monospace; font-size: 9px; line-height: 13.5px; letter-spacing: 0.15em; text-transform: uppercase; font-weight: 500; color: rgba(255,255,255,.65); }
.bm-chat-close { margin-left: auto; flex: 0 0 auto; width: 40px; height: 40px; display: flex; align-items: center; justify-content: center; background: none; border: 0; color: #fff; font-size: 26px; line-height: 1; cursor: pointer; }
.bm-chat-close:hover { color: var(--red-on-dark); }

.bm-chat-log { flex: 1 1 auto; min-height: 0; overflow-y: auto; overscroll-behavior: contain; padding: 16px; background: #F8F7F4; display: flex; flex-direction: column; gap: 10px; }
.bm-chat-msg { max-width: 86%; padding: 10px 12px; background: #fff; border: 1px solid #E5E5E0; align-self: flex-start; }
.bm-chat-msg.me { align-self: flex-end; background: #B43335; border-color: #B43335; color: #fff; }
.bm-chat-msg.note { max-width: 100%; align-self: stretch; background: transparent; border: 0; padding: 2px 0; color: #6B6B66; font-size: 13px; line-height: 18px; }
.bm-chat-msg a { text-decoration: underline; text-underline-offset: 2px; }
.bm-chat-chips { display: flex; flex-wrap: wrap; gap: 8px; }
.bm-chat-chip { padding: 8px 12px; background: #fff; border: 1px solid #E5E5E0; color: #0A0E14; font-family: inherit; font-size: 13px; font-weight: 500; line-height: 19.5px; cursor: pointer; transition: border-color .2s; }
.bm-chat-chip:hover { border-color: #0A0E14; }

.bm-chat-form { display: flex; gap: 8px; padding: 12px; background: #fff; border-top: 1px solid #E5E5E0; }
.bm-chat-input { flex: 1 1 auto; min-width: 0; height: 44px; padding: 0 12px; background: #F8F7F4; border: 1px solid #E5E5E0; border-radius: 0; color: #0A0E14; font-family: inherit; font-size: 16px; -webkit-appearance: none; appearance: none; }
.bm-chat-input:focus { outline: none; border-color: #0A0E14; background: #fff; }
.bm-chat-send { flex: 0 0 auto; height: 44px; padding: 0 16px; background: #B43335; color: #fff; border: 0; font-family: 'Funnel Display', system-ui, sans-serif; font-weight: 600; font-size: 15px; letter-spacing: -0.01em; cursor: pointer; transition: background-color .2s; }
.bm-chat-send:hover { background: #8C2628; }
.bm-chat-foot { display: flex; justify-content: space-between; gap: 12px; padding: 0 12px 10px; background: #fff; font-family: 'JetBrains Mono', monospace; font-size: 9px; line-height: 13.5px; letter-spacing: 0.15em; text-transform: uppercase; font-weight: 500; color: #6B6B66; }
.bm-chat-foot a { color: #0A0E14; white-space: nowrap; }

@media (max-width: 767px) {
  /* The plate stays in the corner, inside the safe area, and leaves room at the end of the page. */
  /* Icon on the right. Compact state clips the text instead of changing the width, so nothing shifts. */
  .bm-chat-plate { right: calc(12px + env(safe-area-inset-right)); bottom: calc(12px + env(safe-area-inset-bottom)); flex-direction: row-reverse; gap: 10px; padding: 6px 6px 6px 14px; transition: clip-path .2s, transform .2s; }
  .bm-chat-label { display: none; }
  .bm-chat-copy { font-size: 13px; }
  .bm-chat-plate.is-compact { clip-path: inset(0 0 0 calc(100% - 44px)); }
  body.bm-chat-open { overflow: hidden; }
  .bm-chat-window { inset: 0; width: auto; height: 100vh; height: 100dvh; border: 0; padding-bottom: env(safe-area-inset-bottom); padding-right: env(safe-area-inset-right); padding-left: env(safe-area-inset-left); }
  .bm-chat-head { padding-top: calc(16px + env(safe-area-inset-top)); }
}

@media (prefers-reduced-motion: reduce) {
  .bm-chat-plate, .bm-chat-chip, .bm-chat-send { transition: none; }
}
