/* Scoped to the assistant; the rest of the site's presentation is unchanged. */
.ivory-chat[hidden], .ivory-chat-launcher[hidden] { display: none; }
.ivory-chat, .ivory-chat * { box-sizing: border-box; }
.ivory-chat {
    position: fixed; left: 24px; bottom: 90px; z-index: 9998;
    width: min(380px, calc(100vw - 32px)); height: min(640px, calc(100dvh - 120px));
    display: flex; flex-direction: column; overflow-x: hidden; overflow-y: auto;
    border: 1px solid #d8d0c2; border-radius: 18px;
    background: #f4f0e8; color: #26231f; box-shadow: 0 20px 60px #0003;
    font-family: 'DM Sans', sans-serif; font-size: 14px; line-height: 1.5;
}
.ivory-chat button, .ivory-chat textarea { font: inherit; }
.ivory-chat button, .ivory-chat-launcher { cursor: pointer; }
.ivory-chat button:disabled { opacity: .5; cursor: wait; }
.ivory-chat :focus-visible, .ivory-chat-launcher:focus-visible { outline: 3px solid #776141; outline-offset: 3px; }
.ivory-chat__header { display: flex; align-items: center; justify-content: space-between; padding: 12px 18px; background: #eae4d8; }
.ivory-chat__header h2 { margin: 0; font-size: 20px; letter-spacing: .22em; }
.ivory-chat__header p { margin: 0; font-size: 10px; letter-spacing: .13em; }
.ivory-chat__header button { width: 44px; height: 44px; border: 0; border-radius: 50%; font-size: 28px; background: transparent; }
.ivory-chat__notice { margin: 0; padding: 10px 16px; font-size: 11px; color: #595248; border-bottom: 1px solid #d8d0c2; }
.ivory-chat__presence { margin: 0; padding: 6px 16px; font-size: 11px; font-weight: 700; color: #42392e; background: #eee8dd; border-bottom: 1px solid #d8d0c2; }
.ivory-chat__messages { flex: 1; min-height: 80px; padding: 14px; overflow-y: auto; overscroll-behavior: contain; }
.ivory-chat__message { margin: 0 22px 12px 0; padding: 10px 12px; border-radius: 12px; background: #fffdf8; overflow-wrap: anywhere; }
.ivory-chat__message strong { display: block; font-size: 11px; margin-bottom: 3px; color: #5f5548; }
.ivory-chat__message span { white-space: pre-wrap; }
.ivory-chat__message--visitor { margin-left: 22px; margin-right: 0; background: #e7dfd1; }
.ivory-chat__message--staff { margin-right: 34px; background: #e6eef3; }
.ivory-chat__message--assistant { background: #fff9e9; border: 1px solid #eadbbd; }
.ivory-chat__message--system { background: transparent; border: 1px dashed #c5baa8; }
.ivory-chat .support-file { display:grid; gap:6px; margin-top:8px; }
.ivory-chat .support-file img { max-width:100%; max-height:180px; object-fit:contain; border-radius:8px; }
.ivory-chat audio { width:100%; max-width:280px; }
.ivory-chat .support-media-controls { display:flex; flex-wrap:wrap; gap:6px; margin-top:8px; }
.ivory-chat .support-media-controls label { font-size:11px; }
.ivory-chat .support-media-controls input { width:180px; font-size:11px; }
.ivory-chat .support-media-controls button { border:1px solid #c5baa8; border-radius:6px; padding:5px 8px; font-size:11px; background:#f4f0e8; color:#302d28; }
.ivory-chat .support-media-controls [hidden] { display:none; }
.ivory-chat .support-media-preview { width:100%; font-size:11px; }
.ivory-chat__quick { display: flex; flex-wrap: wrap; gap: 6px; padding: 4px 14px; }
.ivory-chat__quick button { border: 1px solid #c5baa8; border-radius: 20px; background: transparent; padding: 8px 10px; font-size: 12px; min-height: 36px; }
.ivory-chat__links { display: flex; flex-wrap: wrap; gap: 6px 12px; padding: 8px 16px; font-size: 12px; }
.ivory-chat__links a { color: #4b4133; text-decoration: underline; text-underline-offset: 3px; }
.ivory-chat__form { padding: 10px 14px; border-top: 1px solid #d8d0c2; }
.ivory-chat__form label { display: block; margin-bottom: 4px; font-size: 12px; }
.ivory-chat__compose { display: flex; align-items: center; gap: 8px; }
.ivory-chat__compose textarea { width: 100%; min-width: 0; resize: none; padding: 8px; border: 1px solid #bdb3a4; border-radius: 8px; background: #fffdf8; color: #26231f; font-size: 16px; }
.ivory-chat__compose button { min-width: 52px; min-height: 44px; border: 0; border-radius: 24px; background: #302d28; color: #f4f0e8; }
.ivory-chat__hint { margin: 6px 0 0; font-size: 10px; color: #62594c; }
.ivory-chat__status { min-height: 18px; margin: 2px 0 0; font-size: 12px; color: #5a4933; }
.ivory-chat__reveal { border: 0; padding: 4px 0; text-decoration: underline; font-size: 12px !important; background: transparent; color: #4b4133; }
.ivory-chat__reveal[hidden] { display: none; }
.ivory-chat__sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; border: 0; }
.ivory-chat-launcher { position: fixed; bottom: 24px; left: 24px; z-index: 9997; display: flex; align-items: center; gap: 8px; min-height: 52px; padding: 12px 18px; border: 0; border-radius: 30px; background: #1c1c19; color: #fff; box-shadow: 0 8px 20px #0003; font: 14px Arial, sans-serif; }
.ivory-chat-launcher__unread { position:absolute; top:-7px; right:-5px; display:grid; place-items:center; min-width:25px; height:25px; padding:0 7px; border:2px solid #f4f0e8; border-radius:999px; background:#ef3340; color:#fff; box-shadow:0 4px 12px #0004; font-weight:700; font-size:12px; line-height:1; animation:ivory-unread-pop .35s ease-out; }
.ivory-chat-launcher__unread[hidden] { display:none; }
@keyframes ivory-unread-pop { from { opacity:0; transform:scale(.55); } 70% { transform:scale(1.14); } to { opacity:1; transform:scale(1); } }
.ivory-chat-launcher[aria-expanded="true"] { opacity: 0; pointer-events: none; }

/* Glass treatment keeps the animated interior visible behind the conversation. */
.ivory-chat { background:rgba(244,240,232,.42); border-color:rgba(255,255,255,.52); box-shadow:0 24px 70px rgba(28,24,18,.18); backdrop-filter:blur(7px) saturate(108%); -webkit-backdrop-filter:blur(7px) saturate(108%); }
.ivory-chat__header { background:rgba(234,228,216,.48); }
.ivory-chat__notice, .ivory-chat__presence { background:rgba(238,232,221,.38); }
.ivory-chat__messages { background:rgba(255,255,255,.08); }
.ivory-chat__message { background:rgba(255,253,248,.82); box-shadow:0 6px 18px rgba(51,43,31,.06); }
.ivory-chat__message--visitor { background:rgba(221,209,191,.86); }
.ivory-chat__message--staff { background:rgba(218,235,244,.88); }
.ivory-chat__form { background:rgba(244,240,232,.32); }

@media (max-width: 600px) {
    .ivory-chat {
        left: 12px;
        right: 12px;
        bottom: calc(68px + env(safe-area-inset-bottom, 0px));
        width: auto;
        height: min(440px, calc(100dvh - 150px));
        min-height: 300px;
        border-radius: 16px;
        overflow: hidden;
        background: rgba(244,240,232,.24);
        border-color: rgba(255,255,255,.62);
        box-shadow: 0 14px 40px rgba(28,24,18,.16);
        backdrop-filter: blur(3px) saturate(105%);
        -webkit-backdrop-filter: blur(3px) saturate(105%);
        font-size: 13px;
    }
    .ivory-chat__header { flex: 0 0 auto; min-height: 48px; padding: 7px 12px; background: rgba(234,228,216,.34); }
    .ivory-chat__header h2 { font-size: 16px; }
    .ivory-chat__header p { font-size: 8px; }
    .ivory-chat__header button { width: 36px; height: 36px; font-size: 24px; }
    .ivory-chat__notice { display: none; }
    .ivory-chat__presence { flex: 0 0 auto; padding: 5px 12px; font-size: 10px; background: rgba(238,232,221,.26); }
    .ivory-chat__messages { min-height: 100px; padding: 9px 10px 3px; background: rgba(255,255,255,.03); }
    .ivory-chat__message { margin: 0 34px 7px 0; padding: 7px 9px; border-radius: 10px; background: rgba(255,253,248,.68); line-height: 1.35; box-shadow: 0 3px 10px rgba(51,43,31,.04); }
    .ivory-chat__message--visitor { margin-left: 34px; margin-right: 0; background: rgba(221,209,191,.7); }
    .ivory-chat__message--staff { background: rgba(218,235,244,.72); }
    .ivory-chat__message strong { font-size: 9px; }
    .ivory-chat__quick { flex: 0 0 auto; flex-wrap: nowrap; overflow-x: auto; padding: 5px 10px; scrollbar-width: none; }
    .ivory-chat__quick::-webkit-scrollbar { display: none; }
    .ivory-chat__quick button { flex: 0 0 auto; min-height: 30px; padding: 5px 9px; font-size: 11px; }
    .ivory-chat__links { display: none; }
    .ivory-chat__form { flex: 0 0 auto; padding: 7px 10px 8px; background: rgba(244,240,232,.18); }
    .ivory-chat__form label { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }
    .ivory-chat__compose { gap: 6px; }
    .ivory-chat__compose textarea { height: 42px; min-height: 42px; padding: 9px 10px; border-radius: 12px; background: rgba(255,253,248,.74); }
    .ivory-chat__compose button { min-width: 48px; min-height: 42px; border-radius: 21px; }
    .ivory-chat__hint { display: none; }
    .ivory-chat__status { min-height: 14px; margin-top: 2px; font-size: 9px; line-height: 1.2; }
    .ivory-chat-launcher { left: 14px; bottom: calc(14px + env(safe-area-inset-bottom, 0px)); min-height: 46px; padding: 10px 15px; }
}

@media (max-width: 600px) and (max-height: 620px) {
    .ivory-chat { bottom: 10px; height: calc(100dvh - 20px); min-height: 0; }
    .ivory-chat__quick { display: none; }
}
