#mmr-web-chat,
#mmr-web-chat * { box-sizing: border-box; }
#mmr-web-chat [hidden], #mmr-web-chat[hidden] { display: none !important; }
#mmr-web-chat {
    position: fixed; right: max(18px, env(safe-area-inset-right)); bottom: max(18px, env(safe-area-inset-bottom));
    z-index: 1035; color: #191b1e; font: 15px/1.45 Arial, sans-serif; text-align: left;
}
#mmr-web-chat button { cursor: pointer; text-transform: none; letter-spacing: normal; }
#mmr-web-chat :focus-visible { outline: 3px solid #d1243b; outline-offset: 3px; }
#mmr-web-chat .mmrc-launch {
    display: flex; align-items: center; gap: 10px; min-height: 48px; padding: 10px 18px;
    border: 1px solid #4e5155; border-radius: 30px; background: #1c1d20; color: #fff;
    font: bold 15px/1.2 Arial, sans-serif; box-shadow: 0 3px 15px #0003;
}
#mmr-web-chat .mmrc-launch:hover { background: #323338; }
.mmrc-icon {
    position: relative; width: 21px; height: 16px; border: 2px solid #fff; border-radius: 5px;
}
.mmrc-icon::before {
    content: ''; position: absolute; bottom: -5px; left: 3px; width: 5px; height: 5px;
    border-left: 2px solid #fff; transform: skew(-24deg);
}
.mmrc-icon::after {
    content: ''; position: absolute; top: 5px; left: 3px; width: 4px; height: 3px;
    background: #f34550; box-shadow: 6px 0 #f34550;
}
#mmrc-panel {
    width: min(382px, calc(100vw - 28px)); height: min(510px, calc(100vh - 42px));
    height: min(510px, calc(100dvh - 42px)); display: flex; flex-direction: column; overflow: hidden;
    background: #fff; border: 1px solid #d3d4d6; border-radius: 17px; box-shadow: 0 12px 55px #0004;
}
#mmr-web-chat .mmrc-head {
    position: static; display: flex; flex: none; align-items: center; justify-content: space-between;
    min-height: 56px; padding: 3px 7px 3px 17px; background: #202124; color: #fff;
}
#mmrc-title {
    display: flex; align-items: baseline; gap: 10px; border-left: 3px solid #ef3b48;
    padding: 0 0 0 10px; margin: 0; font: italic 700 17px/1.25 Arial, sans-serif; color: #fff;
}
#mmrc-title span { color: #d1d1d4; font: normal 13px Arial, sans-serif; }
#mmr-web-chat .mmrc-close {
    display: grid; place-items: center; width: 44px; height: 44px; padding: 0;
    border: 0; border-radius: 10px; background: transparent; color: #fff; font: normal 27px/1 Arial, sans-serif;
}
#mmr-web-chat .mmrc-close:hover { background: #36373a; }
.mmrc-log {
    display: flex; flex: 1; min-height: 0; flex-direction: column; align-items: flex-start;
    overflow-y: auto; overscroll-behavior: contain; gap: 10px; padding: 18px 14px 10px;
}
#mmr-web-chat .mmrc-log p {
    max-width: 91%; margin: 0; padding: 10px 13px; border-radius: 12px 12px 12px 3px;
    background: #f1f2f3; color: #202124; font: inherit; white-space: pre-wrap; overflow-wrap: anywhere;
}
#mmr-web-chat .mmrc-log .mmrc-user {
    align-self: flex-end; background: #232428; color: #fff; border-radius: 12px 12px 3px 12px;
}
#mmr-web-chat .mmrc-state { min-height: 20px; margin: 0; padding: 0 14px; color: #53565b; font: 12px/1.45 Arial, sans-serif; }
#mmr-web-chat .mmrc-compose {
    display: flex; align-items: end; gap: 6px; padding: 5px; margin: 2px 12px 0;
    border: 1px solid #b5b7bb; border-radius: 12px; background: #fff;
}
#mmr-web-chat .mmrc-compose:focus-within { border-color: #4d5056; }
#mmrc-message {
    display: block; flex: 1; min-width: 0; min-height: 42px; max-height: 92px; resize: none;
    padding: 10px 6px; margin: 0; border: 0; border-radius: 6px; box-shadow: none;
    background: white; color: #191b1e; font: 16px/1.4 Arial, sans-serif;
}
#mmrc-message:focus { outline: 0; }
#mmr-web-chat .mmrc-send {
    flex: none; width: 44px; height: 44px; border: 0; padding: 0; border-radius: 8px;
    background: #ba2234; color: #fff; font: bold 24px/1 Arial, sans-serif;
}
#mmr-web-chat .mmrc-send:disabled { cursor: default; background: #e2e3e5; color: #666970; }
.mmrc-foot { display: flex; gap: 10px; align-items: center; padding: 9px 14px 12px; color: #61646a; font-size: 11px; }
.mmrc-foot span { flex: 1; }
#mmr-web-chat .mmrc-foot a { color: #444850; text-decoration: underline; }
@media (max-width: 480px) {
    #mmr-web-chat { right: max(10px, env(safe-area-inset-right)); bottom: max(10px, env(safe-area-inset-bottom)); }
    #mmrc-panel { width: calc(100vw - 20px); height: min(490px, calc(100vh - 20px)); height: min(490px, calc(100dvh - 20px)); }
}
