/* Override Chainlit's 600px max-width constraint on the wrapper div around inline Plotly charts.
   The wrapper has: class="max-w-[600px] h-[400px]" style="max-width:fit-content;height:400px"
   Target it via :has() since it contains .inline-plotly as a direct child. */
div:has(> .inline-plotly) {
    max-width: 100% !important;
    width: 100% !important;
}

/* Plotly chart in browser fullscreen mode */
.js-plotly-plot:fullscreen {
    width: 100vw !important;
    height: 100vh !important;
}

#chat-profile-description {
    font-size: 0.75rem;
    padding: 0.25rem 0.5rem;
}

#header div.relative:has(#chat-profiles) {
    display: flex;
    align-items: center;
}

#header div.relative:has(#chat-profiles)::before {
    content: "";
    display: inline-block;
    width: 20px;
    height: 20px;
    background-color: hsl(var(--muted-foreground));
    -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M10 11h.01'/%3E%3Cpath d='M14 6h.01'/%3E%3Cpath d='M18 6h.01'/%3E%3Cpath d='M6.5 13.1h.01'/%3E%3Cpath d='M22 5c0 9-4 12-6 12s-6-3-6-12c0-2 2-3 6-3s6 1 6 3'/%3E%3Cpath d='M17.4 9.9c-.8.8-2 .8-2.8 0'/%3E%3Cpath d='M10.1 7.1C9 7.2 7.7 7.7 6 8.6c-3.5 2-4.7 3.9-3.7 5.6 4.5 7.8 9.5 8.4 11.2 7.4.9-.5 1.9-2.1 1.9-4.7'/%3E%3Cpath d='M9.1 16.5c.3-1.1 1.4-1.7 2.4-1.4'/%3E%3C/svg%3E");
    mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M10 11h.01'/%3E%3Cpath d='M14 6h.01'/%3E%3Cpath d='M18 6h.01'/%3E%3Cpath d='M6.5 13.1h.01'/%3E%3Cpath d='M22 5c0 9-4 12-6 12s-6-3-6-12c0-2 2-3 6-3s6 1 6 3'/%3E%3Cpath d='M17.4 9.9c-.8.8-2 .8-2.8 0'/%3E%3Cpath d='M10.1 7.1C9 7.2 7.7 7.7 6 8.6c-3.5 2-4.7 3.9-3.7 5.6 4.5 7.8 9.5 8.4 11.2 7.4.9-.5 1.9-2.1 1.9-4.7'/%3E%3Cpath d='M9.1 16.5c.3-1.1 1.4-1.7 2.4-1.4'/%3E%3C/svg%3E");
    -webkit-mask-size: contain;
    mask-size: contain;
    -webkit-mask-repeat: no-repeat;
    mask-repeat: no-repeat;
    flex-shrink: 0;
    margin-right: 0.125rem;
}

#chat-profiles {
    font-size: 0.875rem !important;
}

#chat-profiles::before {
    content: "Personality:";
    font-size: 0.875rem;
    font-weight: 500;
    margin-right: 0.375rem;
    color: hsl(var(--muted-foreground));
    white-space: nowrap;
}

#header a:has(img[src*="briefing.svg"]) img {
    display: none;
}

#header a:has(img[src*="briefing.svg"])::before {
    content: "";
    display: inline-block;
    width: 20px;
    height: 20px;
    background-color: hsl(var(--muted-foreground));
    -webkit-mask-image: url("/public/briefing.svg");
    mask-image: url("/public/briefing.svg");
    -webkit-mask-size: contain;
    mask-size: contain;
    -webkit-mask-repeat: no-repeat;
    mask-repeat: no-repeat;
}

/* square corners for elements that hardcode rounded-3xl / rounded-2xl */
#message-composer {
    border-radius: 0 !important;
}

/* user message bubbles */
.step .bg-accent.rounded-3xl {
    border-radius: 0 !important;
}

/* starter category pills and starter buttons */
#starters button.rounded-full,
#starters button.rounded-3xl {
    border-radius: 0 !important;
}

/* monochrome scrollbar */
::selection {
    background-color: hsl(0 0% 50% / 0.3);
}

::-webkit-scrollbar {
    width: 6px;
}

::-webkit-scrollbar-track {
    background: hsl(var(--background));
}

::-webkit-scrollbar-thumb {
    background: hsl(var(--muted));
    border-radius: 0;
}

::-webkit-scrollbar-thumb:hover {
    background: hsl(var(--muted-foreground));
}

/* make links visually distinct in the monochrome theme where text-primary
   is indistinguishable from regular text */
a.text-primary,
.cursor-pointer.text-primary {
    text-decoration: underline;
    text-underline-offset: 2px;
    text-decoration-thickness: 1px;
}

a.text-primary::before,
.cursor-pointer.text-primary::before {
    content: "";
    display: inline-block;
    width: 0.75em;
    height: 0.75em;
    margin-right: 0.2em;
    vertical-align: baseline;
    background-color: currentColor;
    -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M10 13a5 5 0 0 0 7.54.54l3-3a5 5 0 0 0-7.07-7.07l-1.72 1.71'/%3E%3Cpath d='M14 11a5 5 0 0 0-7.54-.54l-3 3a5 5 0 0 0 7.07 7.07l1.71-1.71'/%3E%3C/svg%3E");
    mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M10 13a5 5 0 0 0 7.54.54l3-3a5 5 0 0 0-7.07-7.07l-1.72 1.71'/%3E%3Cpath d='M14 11a5 5 0 0 0-7.54-.54l-3 3a5 5 0 0 0 7.07 7.07l1.71-1.71'/%3E%3C/svg%3E");
    -webkit-mask-size: contain;
    mask-size: contain;
    -webkit-mask-repeat: no-repeat;
    mask-repeat: no-repeat;
}
