/* Live chat bubble. Colors come from site.css (--accent, --paper, --ink, --plate, --quiet, --line).
   One theme only, like the rest of the site (2026-11-13): no dark values here, so the bubble and the panel
   stay parchment and maroon in a dark-mode browser too.
   @date Last edited 2026-11-14 */
.wmc { position: fixed; right: 20px; bottom: 20px; z-index: 50; font: 15px/1.45 var(--font); }
.wmc[hidden] { display: none !important; }
.wmc-bubble { position: relative; width: 60px; height: 60px; border-radius: 50%; border: 0; background: var(--accent); color: var(--on-accent);
  display: grid; place-items: center; cursor: pointer; box-shadow: 0 10px 30px -6px #b7250080, 0 2px 6px #0003; transition: transform .2s; margin-left: auto; }
.wmc-bubble:hover { transform: scale(1.05); }
.wmc-bubble svg { width: 28px; height: 28px; }
.wmc-bubble::after { content: ""; position: absolute; right: 3px; top: 3px; width: 12px; height: 12px; border-radius: 50%; background: #2fbf5a; border: 2px solid var(--paper); }
.wmc[data-online="false"] .wmc-bubble::after { background: #9a9aa0; }
.wmc-badge { position: absolute; left: -4px; top: -4px; min-width: 22px; height: 22px; padding: 0 6px; border-radius: 11px; background: #111; color: #fff;
  font-size: 12px; font-weight: 700; display: grid; place-items: center; border: 2px solid var(--paper); }
/* the preview bubble: a small speech bubble above the launcher, never more than ~260px, dismissible */
.wmc-peek { position: relative; width: max-content; max-width: 260px; margin: 0 0 12px auto; border-radius: 16px 16px 4px 16px;
  border: 1px solid var(--line); background: var(--paper); color: var(--ink); box-shadow: 0 12px 32px -8px #0004;
  animation: wmc-in .25s cubic-bezier(.2,.7,.2,1); }
.wmc-peek-open { display: flex; gap: 10px; align-items: flex-start; width: 100%; margin: 0; padding: 10px 32px 10px 12px; border: 0; border-radius: inherit;
  background: none; color: inherit; text-align: left; font: inherit; font-size: 14px; line-height: 1.35; cursor: pointer; }
.wmc-peek-open:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.wmc-peek-open img { border-radius: 50%; flex: none; }
.wmc-peek-body { display: grid; gap: 1px; min-width: 0; }
.wmc-peek-name { font-weight: 700; font-size: 12px; color: var(--quiet); }
.wmc-peek-text { overflow-wrap: anywhere; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.wmc-peek-x { position: absolute; top: 4px; right: 4px; width: 26px; height: 26px; padding: 0; border: 0; border-radius: 50%; background: transparent;
  color: var(--quiet); display: grid; place-items: center; cursor: pointer; }
.wmc-peek-x:hover, .wmc-peek-x:focus-visible { background: var(--line); color: var(--ink); }
.wmc-peek-x svg { width: 14px; height: 14px; }
.wmc-panel { position: absolute; right: 0; bottom: 76px; width: 370px; height: min(600px, calc(100vh - 120px)); display: flex; flex-direction: column;
  background: var(--paper); color: var(--ink); border-radius: 20px; overflow: hidden; border: 1px solid var(--line);
  box-shadow: 0 24px 64px -12px #0005, 0 4px 12px #0002; animation: wmc-in .22s cubic-bezier(.2,.7,.2,1); }
.wmc-head { display: flex; align-items: center; gap: 12px; padding: 16px 16px 14px; background: var(--accent); color: var(--on-accent); }
.wmc-head img { border-radius: 50%; border: 2px solid #ffffff55; }
.wmc-who { flex: 1; min-width: 0; }
.wmc-name { margin: 0; font-family: var(--font); font-weight: 700; font-size: 1rem; }
.wmc-status { margin: 0; font-size: .8125rem; opacity: .9; }
.wmc-close { width: 36px; height: 36px; border: 0; border-radius: 10px; background: #ffffff22; color: #fff; display: grid; place-items: center; cursor: pointer; }
.wmc-close svg { width: 18px; height: 18px; }
.wmc-list { flex: 1; overflow-y: auto; padding: 16px; display: flex; flex-direction: column; gap: 8px; background: var(--plate); overscroll-behavior: contain; }
.wmc-msg { max-width: 80%; display: flex; flex-direction: column; }
.wmc-msg time { font-size: 11px; color: var(--quiet); margin-top: 3px; padding: 0 6px; }
.wmc-text { margin: 0; padding: 9px 13px; border-radius: 18px; white-space: pre-wrap; overflow-wrap: anywhere; }
.wmc-them { align-self: flex-start; }
.wmc-them .wmc-text { background: var(--paper); border: 1px solid var(--line); border-bottom-left-radius: 6px; }
.wmc-me { align-self: flex-end; align-items: flex-end; }
.wmc-me .wmc-text { background: var(--accent); color: var(--on-accent); border-bottom-right-radius: 6px; }
.wmc-error { align-self: center; margin: 4px 0; font-size: 12px; color: var(--accent); }
.wmc-typing { display: flex; gap: 4px; padding: 0 16px 10px 28px; background: var(--plate); }
.wmc-typing[hidden] { display: none; }
.wmc-typing span { width: 7px; height: 7px; border-radius: 50%; background: var(--quiet); animation: wmc-dot 1.2s infinite; }
.wmc-typing span:nth-child(2) { animation-delay: .15s; } .wmc-typing span:nth-child(3) { animation-delay: .3s; }
.wmc-form { padding: 10px 12px 6px; border-top: 1px solid var(--line); background: var(--paper); }
.wmc-whois { display: grid; gap: 6px; margin-bottom: 8px; }
.wmc-whois[hidden] { display: none; }
.wmc-field, .wmc-input { width: 100%; border: 1px solid var(--line-strong); border-radius: 12px; padding: 9px 12px; background: var(--paper); color: var(--ink);
  font: inherit; outline: none; }
.wmc-field:focus, .wmc-input:focus { border-color: var(--accent); }
.wmc-row { display: flex; gap: 8px; align-items: flex-end; }
.wmc-input { resize: none; max-height: 120px; }
.wmc-send { flex: none; width: 40px; height: 40px; border-radius: 50%; border: 0; background: var(--accent); color: var(--on-accent); display: grid; place-items: center; cursor: pointer; }
.wmc-send svg { width: 18px; height: 18px; }
.wmc-note { margin: 0; padding: 4px 14px 10px; font-size: 11px; color: var(--quiet); background: var(--paper); }
.wmc-note a { color: inherit; }
@keyframes wmc-in { from { opacity: 0; transform: translateY(10px) scale(.98); } }
@keyframes wmc-dot { 0%, 60%, 100% { opacity: .3; transform: none; } 30% { opacity: 1; transform: translateY(-3px); } }
@media (max-width: 480px) {
  .wmc { right: 16px; bottom: 16px; }
  .wmc[data-open="true"] { inset: 0; }
  .wmc[data-open="true"] .wmc-bubble, .wmc[data-open="true"] .wmc-peek { display: none; }
  .wmc-peek { max-width: min(260px, calc(100vw - 32px)); }
  .wmc-panel { position: fixed; inset: 0; width: auto; height: auto; border-radius: 0; border: 0; }
}
@media (prefers-reduced-motion: reduce) { .wmc-panel, .wmc-peek { animation: none; } .wmc-typing span { animation: none; opacity: .6; } }

/* small print at the bottom of every page */
.smallprint { max-width: 68rem; margin: 0 auto; padding: 0 16px 28px; color: var(--quiet); font-size: .75rem; line-height: 1.5; }
.smallprint a, .smallprint .linkish { color: inherit; }
.linkish { background: none; border: 0; padding: 0; font: inherit; text-decoration: underline; text-underline-offset: .2em; cursor: pointer; }
@media (min-width: 880px) { .smallprint { padding: 0 48px 32px; } }

/* Tidio-style launcher: round button with a "Chat with me" pill beside it */
.wmc-launch { display: flex; align-items: center; justify-content: flex-end; gap: 12px; }
.wmc-label { height: 44px; padding: 0 16px; border-radius: 22px; border: 1px solid var(--line); background: var(--paper); color: var(--ink);
  font: inherit; font-size: 15px; cursor: pointer; box-shadow: 0 8px 24px -8px #0004; white-space: nowrap; animation: wmc-in .3s cubic-bezier(.2,.7,.2,1); }
.wmc-label:hover { border-color: var(--accent); }
.wmc-label[hidden] { display: none; }
.wmc-badge { left: auto; right: -4px; top: -4px; background: #e5243b; }
/* the open panel runs nearly the full height of the window, like Tidio's */
.wmc-panel { height: min(680px, calc(100vh - 110px)); width: 380px; }
.wmc-head { padding: 14px 16px; }
.wmc-name { font-size: 1.05rem; }
.wmc-bubble svg path { transition: none; }
@media (max-width: 480px) { .wmc-label { display: none; } }

/* Ukiyo polish: parchment bubbles that read on the tan panel; dot bottom-right, badge top-right */
.wmc { --bubble: #f0dcc4; --bubble-line: #5f4f4930; }
.wmc-them .wmc-text { background: var(--bubble); border: 1px solid var(--bubble-line); color: var(--ink); }
.wmc-bubble::after { top: auto; bottom: 2px; right: 2px; }
.wmc-badge { top: -6px; right: -6px; }
.wmc-peek { background: var(--bubble); border-color: var(--bubble-line); }
.wmc-label { background: var(--bubble); border-color: var(--bubble-line); }
.wmc-label:hover { border-color: var(--accent); }
.wmc-badge { background: #e5243b; }

.wmc-leadnote { margin: 0 0 2px; font-size: 13px; color: var(--quiet); }
.wmc-leadnote[hidden] { display: none; }
.wmc-field[hidden] { display: none; }
.wmc-field.wmc-bad { border-color: var(--accent); box-shadow: 0 0 0 2px color-mix(in srgb, var(--accent) 25%, transparent); }

.wmc-pending { opacity: .6; }

/* folded details: one quiet line until opened */
.wmc-more { justify-self: start; border: 0; background: none; padding: 2px 2px 4px; color: var(--ink); font: inherit; font-size: 13px;
  text-decoration: underline; text-underline-offset: .2em; text-decoration-color: var(--line-strong); cursor: pointer; max-width: 100%;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.wmc-more:hover, .wmc-more:focus-visible { text-decoration-color: var(--accent); }
.wmc-more[hidden], .wmc-fields[hidden] { display: none; }
.wmc-fields { display: grid; gap: 6px; }
/* The visitor's details (chat.js header, "THE VISITOR'S DETAILS", 2026-11-14): the saved line with its "Change
   details" button, the "Save details" / "Cancel" buttons under the open fields, and the line that confirms a save
   or names a problem. The same rules as in cloudcut-team-site/site/assets/chat.css, in this site's colours. */
.wmc-saved { display: flex; align-items: center; gap: 10px; font-size: 13px; min-width: 0; }
.wmc-saved[hidden], .wmc-actions[hidden] { display: none; }
.wmc-saved-text { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--quiet); }
.wmc-actions { display: flex; gap: 8px; align-items: center; }
.wmc-save, .wmc-cancel, .wmc-change { flex: none; min-height: 34px; padding: 0 14px; border-radius: 17px; font: inherit; font-size: 13px; font-weight: 600; cursor: pointer; }
.wmc-save { border: 1.5px solid var(--accent); background: var(--accent); color: var(--on-accent); }
.wmc-cancel, .wmc-change { border: 1.5px solid var(--line-strong); background: var(--paper); color: var(--ink); }
.wmc-cancel:hover, .wmc-change:hover { border-color: var(--accent); }
.wmc-save:focus-visible, .wmc-cancel:focus-visible, .wmc-change:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }
.wmc-detailnote { margin: 0; font-size: 12px; line-height: 1.4; color: var(--quiet); }
.wmc-detailnote:empty { display: none; }
.wmc-detailnote.wmc-problem { color: var(--accent); font-weight: 600; }

/* higher contrast: the message box, the send button and the close button */
.wmc { --field-bg: #fbf3ea; --field-line: #3b302c8c; }
.wmc-field, .wmc-input { background: var(--field-bg); border: 1.5px solid var(--field-line); color: var(--ink); }
.wmc-field::placeholder, .wmc-input::placeholder { color: var(--quiet); opacity: 1; }
.wmc-field:focus, .wmc-input:focus { border-color: var(--accent); box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 22%, transparent); }
.wmc-send { width: 44px; height: 44px; box-shadow: 0 2px 8px -2px #0006; }
.wmc-send svg { width: 20px; height: 20px; }
.wmc-send:focus-visible { outline: 3px solid var(--ink); outline-offset: 2px; }
.wmc-close { width: 38px; height: 38px; border-radius: 50%; background: var(--on-accent); color: var(--accent); box-shadow: 0 1px 4px #0004; }
.wmc-close svg { width: 18px; height: 18px; stroke-width: 2.8; }
.wmc-close:focus-visible { outline: 3px solid var(--on-accent); outline-offset: 2px; }

/* phones: full screen, compact header, 16px inputs (no iOS zoom), clear of the home bar and keyboard */
@media (max-width: 480px) {
  .wmc-panel { height: 100dvh; }
  .wmc-head { padding: 10px 12px; padding-top: max(10px, env(safe-area-inset-top)); gap: 10px; }
  .wmc-head img { width: 32px; height: 32px; }
  .wmc-name { font-size: .95rem; }
  .wmc-status { font-size: .75rem; }
  .wmc-list { padding: 12px; }
  .wmc-msg { max-width: 86%; }
  .wmc-form { padding: 8px 10px 4px; }
  .wmc-field, .wmc-input { font-size: 16px; padding: 8px 12px; }
  .wmc-fields { gap: 5px; }
  .wmc-note { padding: 2px 12px max(8px, env(safe-area-inset-bottom)); font-size: 10.5px; }
}
