.separate-containers .site-main{
    margin:0px;
}

/* The chat page's <main> is a flex item inside the theme's #content. With no
   flex basis it shrank to its content (~358px on a 1280px screen) and stuck to
   the left edge, so the shell's own `margin:0 auto` had nothing to centre in. */
.facenimal-chat-page {
    box-sizing: border-box;
    flex: 1 1 auto;
    margin: 0 auto;
    min-width: 0;
    padding: 16px;
    width: 100%;
}

.facenimal-chat-shell {
    background: #fff;
    border: 1px solid #e4e7ec;
    border-radius: 12px;
    box-sizing: border-box;
    color: #17212b;
    display: grid;
    gap: 0;
    grid-template-columns: minmax(220px, 320px) minmax(0, 1fr);
    margin: 0 auto;
    max-width: 1120px;
    /* A *definite* height, not min-height: the two columns scroll inside the
       shell, and a scroll container can only exist inside a bounded parent.
       With min-height the shell grew with the conversation (3735px at 60
       messages) and the whole page scrolled instead. */
    height: min(72vh, 720px);
    overflow: hidden;
    width: 100%;
}

.facenimal-chat-inbox {
    background: #f8fafc;
    border-right: 1px solid #e4e7ec;
    display: grid;
    grid-template-rows: auto minmax(0, 1fr);
    min-height: 0;
    min-width: 0;
}

.facenimal-chat-head {
    align-items: center;
    border-bottom: 1px solid #e4e7ec;
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    min-height: 86px;
    padding: 10px 14px;
    background: #d8eef0;
}

.facenimal-chat-logo {
    align-items: center;
    background-color: transparent;
    /* Bundled, not pulled from facenimal.com: a stylesheet that depends on the
       production site leaves the chip empty whenever that is unreachable, local
       development included. `contain` because the file is transparent — it has
       no field of its own with which to hide what `cover` crops. */
    background-image: url("../img/facenimal-logo-light.png");
    background-position: center;
    background-repeat: no-repeat;
    background-size: contain;
    border: 0;
    border-radius: 17px;
    display: inline-flex;
    flex: 0 0 150px;
    height: 43px;
    justify-content: center;
    overflow: hidden;
    padding: 3px;
    position: relative;
    width: 150px;
}

.facenimal-chat-title {
    flex: 0 0 100%;
    min-width: 0;
}

.facenimal-chat-head h2 {
    font-size: 15px;
    font-weight: 900;
    margin: 0;
}

.facenimal-chat-head small {
    color: #667085;
    display: block;
    font-size: 11px;
    font-weight: 700;
    line-height: 1.25;
    margin-top: 2px;
}

.facenimal-chat-view-menu {
    margin-left: auto;
    position: relative;
}

.facenimal-chat-view-menu summary {
    align-items: center;
    background: transparent;
    border-radius: 999px;
    color: #000;
    display: inline-flex;
    gap: 5px;
    font-size: 13px;
    font-weight: 500;
    list-style: none;
    min-height: 28px;
    padding: 0 10px;
    cursor: pointer;
}

.facenimal-chat-view-menu summary::-webkit-details-marker {
    display: none;
}

.facenimal-chat-view-menu summary svg {
    fill: none;
    height: 14px;
    stroke: currentColor;
    stroke-linecap: round;
    stroke-linejoin: round;
    stroke-width: 2.2;
    width: 14px;
}

.facenimal-chat-view-menu[open] summary {
    background: transparent;
    border-color: #006400;
    color: #006400;
}

.facenimal-chat-view-tabs {
    background: #fff;
    border: 1px solid #d0d5dd;
    border-radius: 10px;
    box-shadow: 0 12px 28px rgba(16, 24, 40, .14);
    display: grid;
    gap: 3px;
    min-width: 136px;
    padding: 5px;
    position: absolute;
    right: 0;
    top: calc(100% + 6px);
    z-index: 20;
}

.facenimal-chat-view-tabs a {
    align-items: center;
    border-radius: 7px;
    color: #344054;
    display: flex;
    font-size: 12px;
    font-weight: 900;
    min-height: 30px;
    padding: 0 9px;
    text-decoration: none;
}

.facenimal-chat-view-tabs a.is-active,
.facenimal-chat-view-tabs a:hover,
.facenimal-chat-view-tabs a:focus {
    background: #006400;
    border-color: #006400;
    color: #fff;
}

.facenimal-chat-thread em {
      align-items: center;
      background: #fff;
      border-radius: 999px;
      color: #006400;
      display: inline-flex;
      font-size: 18px;
      font-style: normal;
      font-weight: 500;
      height: 35px;
      justify-content: center;
      min-width: 24px;
      padding: 0 7px;
      box-shadow: 0 -8px 24px rgba(16, 24, 40, .08);
      width: 35px;
}

.facenimal-chat-thread-list {
    /* align-content:start — the row track is 1fr now, and the default stretch
       would blow every conversation row up to fill a half-empty column. */
    align-content: start;
    display: grid;
    min-height: 0;
    overflow-y: auto;
}

.facenimal-chat-thread-row {
    align-items: center;
    border-bottom: 1px solid #e4e7ec;
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    min-height: 64px;
    position: relative;
}

.facenimal-chat-thread {
    align-items: center;
    color: inherit;
    display: grid;
    gap: 9px;
    grid-template-columns: 42px minmax(0, 1fr) auto;
    min-height: 64px;
    padding: 9px 8px 9px 12px;
    text-decoration: none;
}

.facenimal-chat-thread-row:hover,
.facenimal-chat-thread-row:focus-within,
.facenimal-chat-thread-row.is-active {
    background: #ecfdf3;
}

.facenimal-chat-thread:hover,
.facenimal-chat-thread:focus {
    color: inherit;
    text-decoration: none;
}

.facenimal-chat-thread-action {
    align-items: center;
    display: flex;
    justify-content: center;
    margin: 0;
    padding-right: 10px;
}

.facenimal-chat-thread-action button {
    align-items: center;
    background: #fff;
    border: 1px solid #fecdca;
    border-radius: 999px;
    color: #b42318;
    cursor: pointer;
    display: inline-flex;
    font-size: 12px !important;
    font-weight: 900;
    font: inherit;
    min-height: 30px;
    justify-content: center;
    line-height: 1;
    padding: 0 12px;
    text-decoration: none;
    white-space: nowrap;
}

.facenimal-chat-thread-action button:hover,
.facenimal-chat-thread-action button:focus {
    background: #fef3f2;
    border-color: #fecdca;
    color: #b42318;
}

.facenimal-chat-thread img,
.facenimal-chat-message > img {
    border-radius: 999px;
    display: block;
    height: 42px;
    object-fit: cover;
    width: 42px;
}

.facenimal-chat-thread strong,
.facenimal-chat-thread small {
    display: block;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.facenimal-chat-thread strong {
    font-size: 13px;
    font-weight: 900;
}

.facenimal-chat-thread small {
    color: #667085;
    font-size: 11px;
    font-weight: 700;
}

.facenimal-chat-panel {
    display: grid;
    grid-template-rows: minmax(0, 1fr) auto;
    min-height: 0;
    min-width: 0;
}

.facenimal-chat-mobile-head {
    display: none;
}

/* Messages sit at the bottom, but this is also the scroll container, and
   `align-content: end` overflows out of its *top* — a region the browser does
   not scroll. It reported scrollHeight === clientHeight (nothing to scroll)
   while 4013px of history sat above the viewport, unreachable: the frozen
   chat on phones. A bottom-pinning auto margin overflows downwards instead,
   which is scrollable. Do not go back to align-content/justify-content here. */
.facenimal-chat-messages {
    background: #fff;
    display: flex;
    flex-direction: column;
    gap: 8px;
    min-height: 0;
    overflow-y: auto;
    overscroll-behavior: contain;
    padding: 14px;
}

.facenimal-chat-messages > :first-child {
    margin-top: auto;
}

.facenimal-chat-message {
    align-items: end;
    display: flex;
    gap: 7px;
    max-width: min(78%, 620px);
}

.facenimal-chat-message.is-mine {
    align-self: flex-end;
}

.facenimal-chat-message div {
    background: #f2f4f7;
    border: 1px solid #e4e7ec;
    border-radius: 14px;
    padding: 8px 10px;
}

.facenimal-chat-message.is-mine div {
    background: #ecfdf3;
    border-color: #8fd8a8;
}

.facenimal-chat-message p {
    font-size: 13px;
    line-height: 1.35;
    margin: 0;
    white-space: pre-wrap;
    word-break: break-word;
}

.facenimal-chat-form {
    align-items: flex-end;
    background: #d8eef0;
    border-top: 1px solid #d0d5dd;
    display: flex;
    gap: 6px;
    padding: 6px;
}

.facenimal-chat-input {
    max-height: 132px;
    min-height: 34px;
}

.facenimal-chat-send {
    flex: 0 0 34px;
    height: 34px;
    min-height: 34px;
    width: 34px;
}

.facenimal-chat-send svg {
    fill: none;
    height: 19px;
    stroke: currentColor;
    stroke-linecap: round;
    stroke-linejoin: round;
    stroke-width: 2.4;
    width: 19px;
}

.facenimal-chat-empty {
    color: #667085;
    font-size: 13px;
    font-weight: 800;
    margin: 0;
    padding: 14px;
}

.facenimal-chat-button {
    align-items: center;
    background: #006400;
    border: 1px solid #006400;
    border-radius: 999px;
    color: #fff !important;
    display: inline-flex;
    font-size: 12px;
    font-weight: 900;
    min-height: 32px;
    padding: 0 12px;
    text-decoration: none;
}

@media (max-width: 720px) {
    body.facenimal-chat-mobile-open {
        overflow: hidden;
        padding-bottom: 0;
    }

    body.facenimal-chat-mobile-open .facenimal-mobile-menu-wrap {
        display: none;
    }

    /* One panel at a time on a phone: the inbox is the page (it scrolls with
       it), and an open conversation covers it as a fixed layer that scrolls
       inside itself. So the shell drops the desktop height here. */
    .facenimal-chat-shell {
        border-left: 0;
        border-radius: 0;
        border-right: 0;
        display: block;
        height: auto;
        min-height: auto;
        overflow: visible;
    }

    .facenimal-chat-inbox {
        background: #fff;
        border-right: 0;
        display: block;
    }

    .facenimal-chat-thread-list {
        display: grid;
        max-height: none;
        overflow: visible;
    }

    .facenimal-chat-thread-row {
        border-bottom: 0;
        border-top: 1px solid #e4e7ec;
        grid-template-columns: minmax(0, 1fr) auto;
        min-height: 66px;
        min-width: 0;
    }

    .facenimal-chat-thread {
        grid-template-columns: 44px minmax(0, 1fr) auto;
        padding: 10px 8px 10px 12px;
    }

    .facenimal-chat-thread em {
        position: static;
    }

    .facenimal-chat-panel {
        background: #fff;
        bottom: 0;
        display: grid;
        grid-template-rows: 56px minmax(0, 1fr) auto;
        left: 0;
        min-height: 0;
        opacity: 0;
        pointer-events: none;
        position: fixed;
        right: 0;
        top: 0;
        transform: translateX(100%);
        transition: opacity 0.16s ease, transform 0.18s ease;
        z-index: 100001;
    }

    .facenimal-chat-shell.is-conversation-open .facenimal-chat-panel {
        opacity: 1;
        pointer-events: auto;
        transform: translateX(0);
    }

    .facenimal-chat-mobile-head {
        align-items: center;
        background: #fff;
        border-bottom: 1px solid #e4e7ec;
        display: flex;
        gap: 8px;
        min-height: 56px;
        padding: calc(env(safe-area-inset-top, 0px) + 4px) 10px 4px;
    }

    .facenimal-chat-mobile-close {
        align-items: center;
        background: #f2f4f7;
        border: 1px solid #e4e7ec;
        border-radius: 999px;
        color: #17212b;
        display: inline-flex;
        flex: 0 0 38px;
        height: 38px;
        justify-content: center;
        padding: 0;
        width: 38px;
    }

    .facenimal-chat-mobile-close svg {
        fill: none;
        height: 22px;
        stroke: currentColor;
        stroke-linecap: round;
        stroke-linejoin: round;
        stroke-width: 2.2;
        width: 22px;
    }

    .facenimal-chat-mobile-profile {
        align-items: center;
        color: inherit;
        display: inline-flex;
        gap: 8px;
        min-width: 0;
        text-decoration: none;
    }

    .facenimal-chat-mobile-profile img {
        border-radius: 999px;
        height: 36px;
        object-fit: cover;
        width: 36px;
    }

    .facenimal-chat-mobile-profile strong {
        display: block;
        font-size: 13px;
        font-weight: 900;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
    }

    .facenimal-chat-messages {
        padding: 12px;
    }

    .facenimal-chat-message {
        max-width: 88%;
    }

    .facenimal-chat-form {
        padding: 6px 6px calc(env(safe-area-inset-bottom, 0px) + 6px);
    }
}

/* The placeholder would otherwise be pinned to the bottom-left corner of a
   wide empty panel; auto margins centre it on both axes. */
.facenimal-chat-messages > .facenimal-chat-empty {
    margin: auto;
    max-width: 340px;
    text-align: center;
}

/* Until a conversation is chosen there is nobody to write to — the composer
   invited typing into nothing. */
.facenimal-chat-panel:has(.facenimal-chat-empty.is-no-thread) .facenimal-chat-form {
    display: none;
}

/* Header icon (the [facenimal_chat_button] shortcode), matching the
   notifications button so the two sit together in the site header. */
.facenimal-chat-shortcode-button {
    align-items: center;
    color: inherit;
    display: inline-flex;
    gap: 6px;
    justify-content: center;
    min-height: 30px;
    min-width: 30px;
    position: relative;
    text-decoration: none;
}

.facenimal-chat-shortcode-button svg {
    fill: none;
    height: 22px;
    stroke: currentColor;
    stroke-linecap: round;
    stroke-linejoin: round;
    stroke-width: 1.8;
    width: 22px;
}

.facenimal-chat-shortcode-button:hover,
.facenimal-chat-shortcode-button:focus {
    color: #006400;
}

.facenimal-chat-shortcode-count {
    align-items: center;
    background: #b42318;
    border: 2px solid #fff;
    border-radius: 999px;
    color: #fff;
    display: inline-flex;
    font-size: 10px;
    font-weight: 900;
    justify-content: center;
    line-height: 1;
    min-height: 17px;
    min-width: 17px;
    padding: 0 4px;
    position: absolute;
    right: -6px;
    top: -4px;
}

.facenimal-chat-shortcode-count[hidden] {
    display: none !important;
}
