/* Messaging bubble, inbox page and Help Desk. Plain CSS so it does not depend on the asset build. */
.bcm {
    --bcm-accent: #1a73e8;
    --bcm-accent-text: #fff;
    --bcm-bg: #fff;
    --bcm-soft: #f4f6f8;
    --bcm-line: #e3e6ea;
    --bcm-text: #1f2328;
    --bcm-muted: #687079;
    --bcm-warn-bg: #fff5d6;
    --bcm-warn-text: #6b4e00;
    --bcm-note-bg: #fdf3e1;
    font-size: 14px;
    line-height: 1.45;
    color: var(--bcm-text);
}
.bcm *, .bcm *::before, .bcm *::after { box-sizing: border-box; }

/* Bubble */
.bcm--bubble { position: fixed; right: 20px; bottom: 20px; z-index: 1040; }
.bcm-launcher {
    width: 56px; height: 56px; border-radius: 50%; border: 0;
    background: var(--bcm-accent); color: var(--bcm-accent-text);
    display: flex; align-items: center; justify-content: center;
    font-size: 22px; cursor: pointer; position: relative;
    box-shadow: 0 6px 20px rgba(0, 0, 0, .18); text-decoration: none;
}
.bcm-launcher:hover, .bcm-launcher:focus { color: var(--bcm-accent-text); filter: brightness(1.05); }
.bcm-launcher:focus-visible { outline: 3px solid rgba(26, 115, 232, .4); outline-offset: 2px; }
.bcm-badge {
    position: absolute; top: -4px; right: -4px; min-width: 20px; height: 20px; padding: 0 6px;
    border-radius: 10px; background: #d93025; color: #fff; font-size: 12px; font-weight: 600;
    display: inline-flex; align-items: center; justify-content: center;
}
.bcm-badge--inline { position: static; margin-left: 6px; }
/* the bubble: a red dot while something is unread (no number) */
.bcm-dot { position: absolute; top: 1px; right: 1px; width: 15px; height: 15px; border: 2px solid #fff; border-radius: 50%; background: #d93025; box-shadow: 0 1px 3px rgba(0, 0, 0, .25); }

.bcm--bubble .bcm-panel {
    position: absolute; right: 0; bottom: 70px; width: 380px; max-width: calc(100vw - 32px);
    height: 560px; max-height: calc(100vh - 110px);
    box-shadow: 0 12px 40px rgba(0, 0, 0, .2);
}
.bcm-panel {
    background: var(--bcm-bg); border: 1px solid var(--bcm-line); border-radius: 12px;
    display: flex; flex-direction: column; overflow: hidden;
}
.bcm--page .bcm-panel { min-height: 520px; height: 70vh; }

.bcm-head { display: flex; align-items: center; gap: 8px; padding: 12px 14px; border-bottom: 1px solid var(--bcm-line); }
.bcm-title { flex: 1; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.bcm-icon { border: 0; background: none; color: var(--bcm-muted); width: 32px; height: 32px; border-radius: 6px; cursor: pointer; }
.bcm-icon:hover { background: var(--bcm-soft); color: var(--bcm-text); }

.bcm-tabs { display: flex; gap: 4px; padding: 8px 10px; border-bottom: 1px solid var(--bcm-line); overflow-x: auto; }
.bcm-tab { border: 0; background: none; padding: 6px 10px; border-radius: 16px; color: var(--bcm-muted); cursor: pointer; white-space: nowrap; }
.bcm-tab.is-active { background: var(--bcm-soft); color: var(--bcm-text); font-weight: 600; }

.bcm-body { flex: 1; display: flex; flex-direction: column; overflow-y: auto; min-height: 0; }

/* List */
.bcm-item {
    display: grid; grid-template-columns: 1fr auto; gap: 2px 8px; width: 100%; text-align: left;
    padding: 10px 14px; border: 0; border-bottom: 1px solid var(--bcm-line); background: none; cursor: pointer;
}
.bcm-item:hover { background: var(--bcm-soft); }
.bcm-item.is-unread .bcm-item-title { font-weight: 700; }
.bcm-item-type { grid-column: 1 / -1; font-size: 11px; text-transform: uppercase; letter-spacing: .04em; color: var(--bcm-muted); }
.bcm-type--support { color: #8a4b00; }
.bcm-item-title { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.bcm-item-last { grid-column: 1; color: var(--bcm-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-size: 13px; }
.bcm-item-meta { grid-column: 2; grid-row: 2 / 4; text-align: right; font-size: 12px; color: var(--bcm-muted); display: flex; flex-direction: column; align-items: flex-end; gap: 4px; }
.bcm-empty { padding: 32px 20px; text-align: center; color: var(--bcm-muted); }

/* Status */
.bcm-status { display: inline-block; font-size: 11px; padding: 1px 8px; border-radius: 10px; background: var(--bcm-soft); color: var(--bcm-muted); }
.bcm-status--open { background: #e6f4ea; color: #137333; }
.bcm-status--pending { background: #fef7e0; color: #8a5a00; }
.bcm-status--resolved, .bcm-status--closed { background: #eceff1; color: #5f6368; }

/* Thread */
.bcm-toolbar { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; padding: 8px 12px; border-bottom: 1px solid var(--bcm-line); }
.bcm-thread { flex: 1; overflow-y: auto; padding: 12px; display: flex; flex-direction: column; gap: 10px; background: var(--bcm-soft); min-height: 120px; }
.bcm-thread--page { max-height: 60vh; border-radius: 8px; margin-bottom: 16px; }
.bcm-msg { max-width: 85%; align-self: flex-start; background: var(--bcm-bg); border: 1px solid var(--bcm-line); border-radius: 10px; padding: 8px 10px; }
.bcm-msg.is-mine { align-self: flex-end; background: #e8f0fe; border-color: #d2e3fc; }
.bcm-msg.is-internal { background: var(--bcm-note-bg); border-style: dashed; }
.bcm-msg-meta { display: flex; flex-wrap: wrap; gap: 6px; font-size: 12px; color: var(--bcm-muted); margin-bottom: 2px; }
.bcm-msg-body { white-space: normal; overflow-wrap: anywhere; }
.bcm-system { align-self: center; font-size: 12px; color: var(--bcm-muted); text-align: center; max-width: 90%; }
.bcm-tag { font-size: 11px; padding: 0 6px; border-radius: 8px; background: var(--bcm-line); }
.bcm-tag--warn { background: var(--bcm-warn-bg); color: var(--bcm-warn-text); }
.bcm-file { display: block; margin-top: 4px; font-size: 13px; overflow-wrap: anywhere; }

/* Who wrote a contact form / support form ticket (staff only) */
.bcm-guest-card { padding: 10px 12px; border-bottom: 1px solid var(--bcm-line); background: var(--bcm-bg); font-size: 13px; }
.bcm-guest-card-who { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin-bottom: 4px; }
.bcm-guest-card-who strong { font-size: 14px; }
.bcm-guest-card-lines { display: flex; flex-wrap: wrap; gap: 4px 16px; }
.bcm-guest-card-lines a { color: var(--bcm-accent); overflow-wrap: anywhere; }
.bcm-guest-card-lines .fa { margin-right: 4px; }
.bcm-guest-card-note { margin: 4px 0 0; color: var(--bcm-muted); font-size: 12px; }

.bcm-warning { margin: 8px 12px 0; padding: 8px 10px; border-radius: 8px; background: var(--bcm-warn-bg); color: var(--bcm-warn-text); font-size: 13px; }
.bcm-compose { padding: 10px 12px; border-top: 1px solid var(--bcm-line); display: flex; flex-direction: column; gap: 6px; }
.bcm-compose textarea, .bcm-form input, .bcm-form select, .bcm-form textarea {
    width: 100%; border: 1px solid var(--bcm-line); border-radius: 8px; padding: 8px 10px; font: inherit; color: inherit; background: var(--bcm-bg);
}
.bcm-compose textarea { resize: vertical; min-height: 44px; max-height: 160px; }
/* The site theme makes every input and textarea 56px tall with a 56px line height: the subject box came out huge and
   the message box one line high. Sized here for the chat. */
.bcm .bcm-form input, .bcm .bcm-form select { height: 40px; line-height: normal; padding: 8px 10px; font-size: 14px; }
.bcm .bcm-form textarea, .bcm .bcm-compose textarea { height: auto; line-height: 1.5; padding: 8px 10px; font-size: 14px; }
.bcm .bcm-form textarea { min-height: 140px; resize: vertical; }
.bcm-tag--topic { background: #e3f1f1; color: #16585a; }
.bcm-compose-row { display: flex; align-items: center; gap: 8px; }
.bcm-compose-row .bcm-btn { margin-left: auto; }
.bcm-internal { font-size: 12px; color: var(--bcm-muted); margin: 0; display: flex; align-items: center; gap: 4px; }
.bcm-readonly { padding: 10px 14px; border-top: 1px solid var(--bcm-line); }
.bcm-footer { padding: 6px 14px 10px; font-size: 12px; color: var(--bcm-muted); display: flex; flex-wrap: wrap; gap: 4px 12px; align-items: center; }
.bcm-privacy { flex-basis: 100%; margin: 4px 0 0; }
.bcm-link { border: 0; background: none; padding: 0; color: var(--bcm-accent); cursor: pointer; font-size: 12px; }

/* Files */
.bcm-files { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.bcm-attach { margin: 0; cursor: pointer; color: var(--bcm-muted); width: 32px; height: 32px; display: inline-flex; align-items: center; justify-content: center; border-radius: 6px; }
.bcm-attach:hover { background: var(--bcm-soft); }
.bcm-chip { font-size: 12px; background: var(--bcm-soft); border-radius: 12px; padding: 2px 4px 2px 10px; display: inline-flex; align-items: center; gap: 4px; }
.bcm-chip button { border: 0; background: none; cursor: pointer; color: var(--bcm-muted); }

/* Forms and buttons */
.bcm-form { padding: 14px; display: flex; flex-direction: column; gap: 10px; }
.bcm-form label { display: flex; flex-direction: column; gap: 4px; font-weight: 600; font-size: 13px; margin: 0; }
.bcm-form--page { padding: 0; margin-top: 16px; }
.bcm-form--page .btn { align-self: flex-start; }
.bcm-btn { border: 0; border-radius: 8px; padding: 8px 14px; background: var(--bcm-accent); color: var(--bcm-accent-text); font-weight: 600; cursor: pointer; }
.bcm-btn[disabled] { opacity: .6; cursor: default; }
.bcm-btn--small { padding: 4px 10px; font-size: 12px; }
.bcm-btn--ghost { background: var(--bcm-soft); color: var(--bcm-text); }
.bcm-note { color: var(--bcm-muted); font-size: 13px; margin: 0; }
.bcm-error { color: #c5221f; font-size: 12px; }
.bcm-page { padding-top: 40px; padding-bottom: 60px; }
.bcm-page-title { font-size: 28px; margin-bottom: 12px; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

@media (max-width: 575px) {
    .bcm--bubble { right: 12px; bottom: 12px; }
    .bcm--bubble.is-open .bcm-panel { position: fixed; inset: 0; width: 100%; max-width: none; height: 100%; max-height: none; border-radius: 0; }
    .bcm--bubble.is-open .bcm-launcher { display: none; }
}
@media (prefers-reduced-motion: no-preference) {
    .bcm-launcher { transition: transform .15s ease; }
    .bcm-launcher:hover { transform: translateY(-2px); }
}

/* Help Desk: the opened ticket must always be on screen, however long the list is. */
.bcm-hd-panel { scroll-margin-top: 80px; }
@media (min-width: 992px) {
    .bcm-hd-panel { position: sticky; top: 76px; align-self: flex-start; max-height: calc(100vh - 92px); overflow-y: auto; }
}

.bcm-image { margin-top: 6px; }
.bcm-image-open { display: block; max-width: 100%; padding: 0; border: 0; background: none; cursor: zoom-in; }
.bcm-image-open img { display: block; max-width: 100%; max-height: 240px; border-radius: 8px; }
.bcm-file-download { display: inline-block; margin-top: 4px; font-size: 12px; }
.bcm-lightbox { position: fixed; inset: 0; z-index: 2000; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 12px; padding: 16px; background: rgba(0, 0, 0, .85); }
.bcm-lightbox img { max-width: 100%; max-height: calc(100vh - 110px); object-fit: contain; border-radius: 6px; }
.bcm-lightbox-bar { display: flex; gap: 8px; }

.bcm-push { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; font-size: 12px; }
.bcm-push[hidden] { display: none; }
.bcm-panel > .bcm-push { padding: 6px 12px; border-bottom: 1px solid var(--bcm-line); background: var(--bcm-bg); }
.bcm-push[data-state="blocked"], .bcm-push[data-state="failed"] { color: #b45309; }
.bcm-push-action[hidden] { display: none; }

.bcm-push-banner { position: fixed; left: 20px; bottom: 20px; z-index: 1039; display: flex; flex-wrap: wrap; align-items: center; gap: 8px; max-width: min(460px, calc(100vw - 110px)); padding: 10px 14px; border: 1px solid var(--bcm-line); border-radius: 10px; background: #fff; box-shadow: 0 6px 24px rgba(0, 0, 0, .18); font-size: 13px; }
.bcm-push-banner[hidden], .bcm-push-banner[data-state="on"] { display: none; }
.bcm-push-banner[data-state="blocked"] .bcm-push-lead, .bcm-push-banner[data-state="failed"] .bcm-push-lead { display: none; }
/* The X (black, top right) and the question it opens: remind me later / never again */
.bcm-push-banner { padding-right: 38px; }
.bcm-push-close { position: absolute; top: 4px; right: 6px; border: 0; background: none; padding: 2px 6px; color: #000; font-size: 22px; font-weight: 400; line-height: 1; cursor: pointer; }
.bcm-push-close:hover, .bcm-push-close:focus-visible { color: #000; opacity: .7; }
.bcm-push-ask { display: none; }
.bcm-push-banner.is-asking { padding-right: 14px; }
.bcm-push-banner.is-asking > :not(.bcm-push-ask) { display: none; }
.bcm-push-banner.is-asking .bcm-push-ask { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; }

