/* SO Mascotte v0.3.4 — viewport-safe contextual bubbles. */
.so-mascotte .so-assistant-launch {
    position: absolute;
    left: 70.4%;
    top: 83.6%;
    z-index: 8;
    width: max(30px, 16%);
    aspect-ratio: 1;
    padding: 0;
    border: 0;
    border-radius: 50%;
    color: transparent;
    background: transparent;
    box-shadow: none;
    font: 900 clamp(10px, 1.75vw, 21px)/1 Arial, sans-serif;
    cursor: pointer;
    pointer-events: auto !important;
    transform: translate(-50%, -50%);
    animation: so-assistant-ball-float 4.5s ease-in-out infinite;
}
.so-mascotte .so-assistant-launch:hover,
.so-mascotte .so-assistant-launch:focus-visible {
    outline: 2px solid #ffd7d4;
    outline-offset: 0;
}
.so-mascotte.so-render-3d .so-assistant-launch {
    color: #fff;
    text-shadow: 0 1px 1px #64110c, 1px 0 2px #8d100d;
}
.so-mascotte.so-playing .so-assistant-launch { animation-duration: 2.2s; }
@keyframes so-assistant-ball-float {
    0%, 100% { transform: translate(-50%, calc(-50% + 2px)) rotate(-.9deg); }
    50% { transform: translate(-50%, calc(-50% - 5px)) rotate(.9deg); }
}
.so-mascotte .so-assistant-panel {
    position: absolute;
    bottom: calc(100% + 10px);
    right: 0;
    z-index: 10;
    width: min(var(--so-bubble-width, 330px), max(80px, calc(100vw - var(--so-bubble-margin-left, 24px) - var(--so-bubble-margin-right, 24px))));
    max-height: min(66vh, 540px);
    box-sizing: border-box;
    max-width: max(80px, calc(100vw - var(--so-bubble-margin-left, 24px) - var(--so-bubble-margin-right, 24px)));
    overflow: auto;
    overscroll-behavior: contain;
    border-radius: var(--so-bubble-radius, 12px);
    border: 1px solid var(--so-bubble-border, #eccaca);
    background: var(--so-bubble-bg, #fff);
    color: var(--so-bubble-text, #53252a);
    font: 400 var(--so-bubble-size, 13px)/1.48 var(--so-bubble-font, system-ui, sans-serif);
    box-shadow: 0 10px 38px rgb(26 20 23 / 23%);
    text-align: left;
    overflow-wrap: anywhere;
    pointer-events: auto !important;
    user-select: text;
    -webkit-user-select: text;
}
.so-mascotte .so-assistant-panel[hidden],
.so-mascotte .so-assistant-teaser[hidden] { display: none !important; }
.so-mascotte .so-assistant-panel.so-assistant-align-left { right: auto; left: 0; }
.so-mascotte .so-assistant-panel.so-assistant-below {
    top: calc(100% + 10px);
    bottom: auto;
}
.so-mascotte .so-assistant-header {
    position: sticky;
    top: 0;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding: 13px 15px;
    background: var(--so-bubble-accent, #d7181e);
    color: var(--so-bubble-header-text, #fff);
    border-radius: var(--so-bubble-radius, 12px) var(--so-bubble-radius, 12px) 0 0;
    z-index: 2;
}
.so-mascotte .so-assistant-close {
    width: 29px;
    height: 29px;
    padding: 0;
    border: 0;
    background: var(--so-bubble-close-bg, #b6252b);
    color: var(--so-bubble-header-text, #fff);
    border-radius: 7px;
    font: 24px/1 system-ui, sans-serif;
    cursor: pointer;
}
.so-mascotte .so-assistant-content { display: grid; gap: 8px; padding: 15px; }
.so-mascotte .so-assistant-message { margin: 0 0 5px; font-size: 1em; font-weight: 600; }
.so-mascotte .so-assistant-help { margin: 2px 0; font-size: .9em; color: var(--so-bubble-text, #53252a); opacity: .75; }
.so-mascotte .so-assistant-choice {
    display: block;
    box-sizing: border-box;
    width: 100%;
    margin: 0;
    padding: 9px 11px;
    border: 1px solid var(--so-bubble-option-border, #e8dbdb);
    border-radius: 8px;
    background: var(--so-bubble-option-bg, #fff8f8);
    color: var(--so-bubble-option-text, #53252a);
    font: 500 1em/1.4 var(--so-bubble-font, system-ui, sans-serif);
    text-align: left;
    text-decoration: none !important;
    cursor: pointer;
    pointer-events: auto !important;
}
.so-mascotte .so-assistant-choice:hover,
.so-mascotte .so-assistant-choice:focus-visible {
    background: var(--so-bubble-option-hover-bg, #fee9e9);
    border-color: var(--so-bubble-option-hover-border, #df787c);
    color: var(--so-bubble-option-hover-text, #711c20);
}
.so-mascotte .so-assistant-choice.so-assistant-primary {
    background: var(--so-bubble-accent, #d7181e);
    color: var(--so-bubble-primary-text, #fff);
    border-color: var(--so-bubble-accent, #d7181e);
}
.so-mascotte .so-assistant-choice.so-assistant-primary:hover,
.so-mascotte .so-assistant-choice.so-assistant-primary:focus-visible {
    background: var(--so-bubble-primary-hover-bg, #a81016);
    color: var(--so-bubble-primary-hover-text, #fff);
}
.so-mascotte .so-assistant-choice.so-assistant-back { margin-top: 8px; }
.so-mascotte .so-assistant-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: var(--so-bubble-icon-size, 17px);
    height: var(--so-bubble-icon-size, 17px);
    flex: 0 0 var(--so-bubble-icon-size, 17px);
    margin-right: 8px;
    font-size: var(--so-bubble-icon-size, 17px);
    line-height: 1;
    vertical-align: -3px;
}
.so-mascotte .so-assistant-icon.so-assistant-icon-outline {
    color: var(--so-bubble-icon-color, #a82b31);
}
.so-mascotte .so-assistant-primary .so-assistant-icon-outline {
    color: currentColor;
}
.so-mascotte .so-assistant-icon svg {
    display: block;
    width: 100%;
    height: 100%;
    stroke: currentColor;
    stroke-width: 1.8;
    fill: none;
    stroke-linecap: round;
    stroke-linejoin: round;
}
.so-mascotte .so-assistant-knowledge {
    padding: 9px 11px;
    border-left: 3px solid var(--so-bubble-accent, #d7181e);
    border-radius: 8px;
    background: rgb(128 128 128 / 7%);
    overflow-wrap: anywhere;
    line-height: 1.42;
}
.so-mascotte .so-assistant-knowledge-line { margin: 0 0 8px; }
.so-mascotte .so-assistant-knowledge-line:last-child { margin-bottom: 0; }
.so-mascotte .so-assistant-search { display: flex; gap: 5px; }
.so-mascotte .so-assistant-search input,
.so-mascotte .so-assistant-content > input,
.so-mascotte .so-assistant-content > textarea {
    box-sizing: border-box;
    min-width: 0;
    width: 100%;
    padding: 9px;
    border: 1px solid #c7c8ca;
    border-radius: 8px;
    background: #fff;
    color: #252525;
    font: 400 1em/1.4 var(--so-bubble-font, system-ui, sans-serif);
    pointer-events: auto !important;
}
.so-mascotte .so-assistant-search input { flex: 1; }
.so-mascotte .so-assistant-search button {
    padding: 8px 12px;
    border: 0;
    border-radius: 8px;
    color: var(--so-bubble-primary-text, #fff);
    background: var(--so-bubble-accent, #d7181e);
    cursor: pointer;
    pointer-events: auto !important;
}
.so-mascotte .so-assistant-search button:hover,
.so-mascotte .so-assistant-search button:focus-visible {
    color: var(--so-bubble-primary-hover-text, #fff);
    background: var(--so-bubble-primary-hover-bg, #a81016);
}
.so-mascotte .so-assistant-results { display: grid; gap: 7px; }
.so-mascotte .so-assistant-teaser {
    position: absolute;
    left: 0;
    right: auto;
    bottom: 9px;
    z-index: 9;
    width: max-content;
    max-width: min(var(--so-bubble-width, 330px), max(80px, calc(100vw - var(--so-bubble-margin-left, 24px) - var(--so-bubble-margin-right, 24px))));
    padding: 8px 11px;
    border: 1px solid var(--so-bubble-border, #eccaca);
    border-radius: var(--so-bubble-radius, 12px);
    background: var(--so-bubble-bg, #fff);
    box-shadow: 0 3px 14px rgb(0 0 0 / 15%);
    color: var(--so-bubble-text, #53252a);
    font: 600 var(--so-bubble-size, 13px)/1.35 var(--so-bubble-font, system-ui, sans-serif);
    cursor: pointer;
    pointer-events: auto !important;
}
@media (prefers-reduced-motion: reduce) {
    .so-mascotte .so-assistant-launch { transition: none; }
}

.so-mascotte .so-assistant-chat-history { display:grid; gap:8px; overflow-wrap:anywhere; }
.so-mascotte .so-assistant-chat-user { margin:0 0 0 18px; padding:8px 10px; background:var(--so-bubble-accent,#d7181e); color:var(--so-bubble-primary-text,#fff); border-radius:12px 12px 3px 12px; white-space:pre-wrap; }
.so-mascotte .so-assistant-chat-so { margin:0 18px 0 0; padding:9px; background:var(--so-bubble-option-bg,#fff8f8); color:var(--so-bubble-option-text,#53252a); border-radius:12px 12px 12px 3px; }
.so-mascotte .so-assistant-chat-so p { margin:0 0 5px; white-space:pre-wrap; }

/* Official SO mark, independent of mascot rendering and header palette. */
.so-mascotte .so-assistant-brand {
    display: flex;
    align-items: center;
    gap: 9px;
    flex: 1 1 auto;
    min-width: 0;
}
.so-mascotte .so-assistant-logo {
    display: block;
    box-sizing: border-box;
    width: 40px;
    height: 40px;
    flex: 0 0 40px;
    border: 1px solid #e6e6e6;
    border-radius: 10px;
    background: #fff url('../images/so-assistant-logo.png?v=0.3.36') center / 28px auto no-repeat;
}
.so-mascotte .so-assistant-brand-text {
    min-width: 0;
    display: flex;
    flex-direction: column;
    line-height: 1.25;
    overflow-wrap: anywhere;
}
.so-mascotte .so-assistant-brand-text > strong { font-weight: 750; }
.so-mascotte .so-assistant-subtitle {
    display: block;
    font-weight: 400;
    font-size: .85em;
    margin-top: 3px;
}
.so-mascotte .so-assistant-close { flex: 0 0 29px; }
