/* Match the existing TriCore header chat button. */
#trl-chat-launcher {
    font: 400 11px/1.5 Arial, Helvetica, Verdana, sans-serif;
    padding: 0 2px !important;
    color: #fff !important;
    background-color: #007c84;
    border: 1px solid #007c84;
    border-radius: .2rem;
    box-shadow: none;
    vertical-align: middle;
}
#trl-chat-launcher > span,
#trl-chat-launcher > i {
    color: inherit;
}
#trl-chat-launcher:not(:disabled):hover,
#trl-chat-launcher:not(:disabled):focus,
#trl-chat-launcher:not(:disabled):active {
    color: #00636b !important;
    background-color: #fff;
    border-color: #007c84;
    box-shadow: none;
}
#trl-chat-launcher:focus-visible {
    outline: 2px solid #00636b;
    outline-offset: 3px;
}
#trl-chat-launcher:disabled {
    color: #fff !important;
    background-color: #6c757d;
    opacity: 1;
    cursor: not-allowed;
}
/* Match the original button when moved into the mobile navigation. */
.fl-page-nav #trl-chat-launcher {
    line-height: 1.4;
}

/* Salesforce can re-show its launcher when business hours change. The site
   uses the header launcher instead. */
#embeddedMessagingConversationButton { display: none !important; }

/* Override Salesforce's inline transparent background on the expanded iframe. */
#embeddedMessagingFrame.isMaximized {
    background-color: #fff !important;
}

.trl-rest-chat {
    position: fixed;
    inset: auto 20px 20px auto;
    z-index: 10001;
    width: min(380px, calc(100vw - 24px));
    height: min(560px, calc(100dvh - 24px));
    max-height: calc(100vh - 24px);
    display: flex;
    flex-direction: column;
    background: #fff;
    color: #222;
    border: 1px solid #ccc;
    border-radius: 8px;
    box-shadow: 0 4px 24px #0003;
    overflow: hidden;
    font: 16px/1.5 Arial, sans-serif;
}
.trl-rest-chat[hidden], .trl-rest-chat [hidden] { display: none !important; }
.trl-rest-chat header { display: flex; align-items: center; justify-content: space-between; padding: 12px; background: #244a65; color: #fff; }
.trl-rest-chat h2 { margin: 0; color: inherit; font-size: 18px; }
.trl-rest-chat button { font: inherit; padding: 8px 12px; }
.trl-rest-chat header button { background: transparent; border: 1px solid #fff; color: #fff; }
.trl-rest-chat form { margin: 0; padding: 12px; }
.trl-rest-chat label { display: block; font-size: 14px; margin-bottom: 10px; }
.trl-rest-chat input { width: 100%; font: inherit; padding: 8px; box-sizing: border-box; }
.trl-rest-chat :focus-visible { outline: 3px solid #0070d2; outline-offset: 2px; }
.trl-rest-prechat { overflow-y: auto; }
.trl-rest-messages { flex: 1; overflow-y: auto; min-height: 0; padding: 12px; }
.trl-rest-messages p { padding: 8px; margin: 0 0 10px; background: #f2f4f5; overflow-wrap: anywhere; }
.trl-rest-messages .trl-rest-user { background: #e3f3ff; }
.trl-rest-compose { display: flex; gap: 8px; border-top: 1px solid #ddd; }
.trl-rest-compose label { flex: 1; min-width: 0; margin: 0; }
.trl-rest-actions { display: flex; flex-wrap: wrap; gap: 6px; padding: 8px 12px; }
.trl-rest-notice { margin: 0; padding: 8px 12px; font-size: 14px; }
@media (max-width: 480px) { .trl-rest-chat { right: 12px; bottom: 12px; } }
