/* latin-ext */
@font-face {
    font-family: 'Poppins';
    font-style: normal;
    font-weight: 400;
    font-display: swap;
    src: url(font/pxiEyp8kv8JHgFVrJJnecmNE.woff2) format('woff2');
    unicode-range: U+0100-02AF, U+0304, U+0308, U+0329, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

/* latin */
@font-face {
    font-family: 'Poppins';
    font-style: normal;
    font-weight: 400;
    font-display: swap;
    src: url(font/pxiEyp8kv8JHgFVrJJfecg.woff2) format('woff2');
    unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+2074, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

:root {
    /* Light Theme */
    --scrollbar-thumb: #c1c1c1;
    --scrollbar-thumb-hover: #a8a8a8;
    --scrollbar-track: #f1f1f1;
    /* Shared hover/focus tokens - keep every interactive element's transition and
       focus indicator consistent instead of each rule picking its own value. */
    --transition-hover: 0.2s ease; /* most prominent duration */
    --focus-ring-color: #0d6efd;

    /* ---- Typography -------------------------------------------------------
       Use these tokens instead of literal values for every font family, weight
       and size. Sizes come in two flavours: --font-size-* resolve against the
       root (rem) and are the default choice, --font-size-rel-* against the
       parent (em) for text that has to scale with whatever surrounds it.
       Only weight 400 has a registered @font-face (see the two blocks at the
       top of this file), so browsers synthesise 600 and 700 from it until the
       matching font files are added.
       ---------------------------------------------------------------------- */

    /* Family */
    --font-family-base: 'Poppins', sans-serif;
    --font-family-mono: SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;

    /* Weight */
    --font-weight-normal: 400;
    --font-weight-semibold: 600;
    --font-weight-bold: 700;

    /* Size scale, 16px root */
    --font-size-2xs: 0.625rem;  /* 10 */
    --font-size-xs: 0.75rem;    /* 12 */
    --font-size-sm: 0.875rem;   /* 14 */
    --font-size-base: 1rem;     /* 16 */
    --font-size-md: 1.125rem;   /* 18 */
    --font-size-lg: 1.25rem;    /* 20 */
    --font-size-xl: 1.375rem;   /* 22 */
    --font-size-2xl: 1.5rem;    /* 24 */
    --font-size-3xl: 2rem;      /* 32 */
    --font-size-4xl: 3rem;      /* 48 */
    --font-size-5xl: 4rem;      /* 64 */

    /* Relative steps, resolved against the parent instead of the root */
    --font-size-rel-xs: 0.7em;  /* markedly smaller than its context */
    --font-size-rel-sm: 0.9em;  /* slightly smaller than its context */
    --font-size-rel-lg: 1.1em;  /* slightly larger than its context */

    /* ---- Radius -----------------------------------------------------------
       Use these tokens instead of literal corner values. The rungs deliberately
       carry Bootstrap's own radius values (see the hook below), so a card, a
       button and a hand-written box round identically. --radius-xl (12) is the
       one rung Bootstrap has no equivalent for; it is the card radius this UI
       uses. --radius-circle is the 50% used for avatars and round icon buttons,
       --radius-pill Bootstrap's stadium shape.
       ---------------------------------------------------------------------- */
    --radius-sm: 0.25rem;   /* 4 */
    --radius-md: 0.375rem;  /* 6 */
    --radius-lg: 0.5rem;    /* 8 */
    --radius-xl: 0.75rem;   /* 12 */
    --radius-2xl: 1rem;     /* 16 */
    --radius-3xl: 2rem;     /* 32 */
    --radius-pill: 50rem;
    --radius-circle: 50%;

    /* ---- Spacing ----------------------------------------------------------
       One ladder for every padding, margin and gap. It has no "base" rung on
       purpose: unlike font-size, spacing has no document-level default to
       anchor one to. --space-* resolve against the root (rem) and are the
       default choice; --space-rel-* against the parent font size (em), for
       blocks whose spacing should track their own text size.
       Bootstrap's p-* /m-* /gap-* utilities compile to 0.25/0.5/1/1.5/3rem,
       which are rungs 2xs, sm, xl, 3xl and 6xl, so class-based spacing already
       lands on this scale and needs no override.
       Values that mirror another dimension rather than the rhythm stay literal
       (the -264px sidebar offsets, calc(4vh - 10px), the prompt-library modal's
       5rem/10rem pair).
       ---------------------------------------------------------------------- */
    --space-3xs: 0.125rem;  /* 2 */
    --space-2xs: 0.25rem;   /* 4 */
    --space-xs: 0.375rem;   /* 6 */
    --space-sm: 0.5rem;     /* 8 */
    --space-md: 0.625rem;   /* 10 */
    --space-lg: 0.75rem;    /* 12 */
    --space-xl: 1rem;       /* 16 */
    --space-2xl: 1.25rem;   /* 20 */
    --space-3xl: 1.5rem;    /* 24 */
    --space-4xl: 2rem;      /* 32 */
    --space-5xl: 2.5rem;    /* 40 */
    --space-6xl: 3rem;      /* 48 */

    /* Relative steps, resolved against the parent instead of the root */
    --space-rel-xs: 0.25em;
    --space-rel-sm: 0.5em;
    --space-rel-md: 1em;
    --space-rel-lg: 1.5em;
    --space-rel-xl: 2em;

    /* Hook Bootstrap's own chain at its root: it derives --bs-body-font-family
       from --bs-font-sans-serif, and .tooltip / .popover read that variable
       directly, so overriding it here is what puts them in the app font too.
       This file loads after bootstrap.min.css, so the override wins on source
       order. */
    --bs-font-sans-serif: var(--font-family-base);
    --bs-font-monospace: var(--font-family-mono);
    --bs-body-font-size: var(--font-size-base);
    --bs-body-font-weight: var(--font-weight-normal);

    /* The same hook for radius: Bootstrap ships these six rungs at :root and
       every .rounded-* utility and component reads them, so re-pointing them at
       the tokens above puts Bootstrap's own chrome on the scale too. The values
       are Bootstrap's own, so nothing moves visually. */
    --bs-border-radius-sm: var(--radius-sm);
    --bs-border-radius: var(--radius-md);
    --bs-border-radius-lg: var(--radius-lg);
    --bs-border-radius-xl: var(--radius-2xl);
    --bs-border-radius-xxl: var(--radius-3xl);
    --bs-border-radius-pill: var(--radius-pill);
}

html[data-bs-theme="dark"] {
    /* Dark Theme */
    --scrollbar-thumb: #6b6b6b;
    --scrollbar-thumb-hover: #888;
    --scrollbar-track: #2d2d2d;
}

body {
    --sidebar: #022257;
    --sidebar-hover: #102b57;
    --background: #ffffff;
    --text: black;
    --button: #007bff;
    --button-hover: #2639ff;
    --button-disabled: #999999;
    --button-secondary: #6c757d;
    --button-secondary-hover: #5c636a;
    --sidebar-text: white;
    --border-footer: #dee2e6;
    --user-message: #FAFCFF;
    --border-user-chat: #E0E0E0;
    --assist-message: #FFFFFF;
    --border-assist-chat: #E0E0E0;
    --chat-input-text: #212529;
    --chat-input-background: #ffffff;
    --chat-hover-button: #bebebe;
    --chat-input-placeholder: #313539;
    --chat-background-disabled: #999999;
    --tooltip-bg: #f5f5f5;
    font-family: var(--font-family-base);
    margin: 0;
}

html[data-bs-theme="dark"] body {
    --sidebar: #1b233a;
    --sidebar-hover: #20283e;
    --text: #f3f3f3;
    --background: #212529;
    --button: #14569b;
    --button-hover: #2639ff;
    --button-disabled: #55595c;
    --sidebar-text: #f3f3f3;
    --border-footer: #3b3d43;
    --user-message: #2e3439;
    --border-user-chat: #454c54;
    --assist-message: #565d63;
    --border-assist-chat: #6e757c;
    --chat-input-text: var(--text);
    --chat-input-background: var(--user-message);
    --chat-input-placeholder: #9aa0a6;
    --button-secondary: #3e454b;
    --button-secondary-hover: #4e555b;
    --tooltip-bg: #2c3136;
}

*,
::after,
::before {
    box-sizing: border-box;
}

@media (prefers-reduced-motion: reduce) {
    *,
    ::after,
    ::before {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* Baseline keyboard-focus indicator for every focusable element. Components with their
   own hover treatment (background/transform change, not just an outline) additionally
   pair a :focus-visible rule with their :hover rule so keyboard users get the same
   feedback as mouse users - this rule is the fallback for everything else.
   Negative offset keeps the ring inside the element's own box - tightly packed
   neighbours (sidebar rows, cards with no gap) sit flush with no gap for an outward
   ring to bleed into, which was causing visual overlap with adjacent divs. */
:focus-visible {
    outline: 2px solid var(--focus-ring-color);
    outline-offset: -2px;
}

/* Bootstrap's font-weight utilities hardcode their numbers, so templates using
   them would bypass the tokens above. Re-point the three the app actually uses.
   The !important matches Bootstrap's own declaration; this file loads after
   bootstrap.min.css, so equal specificity resolves in our favour. */
.fw-normal {
    font-weight: var(--font-weight-normal) !important;
}

.fw-semibold {
    font-weight: var(--font-weight-semibold) !important;
}

.fw-bold {
    font-weight: var(--font-weight-bold) !important;
}

a:not(.chat-message, .chat-message a) {
    cursor: pointer;
    text-decoration: none;
    font-family: var(--font-family-base);
}

li {
    list-style: none;
}

h4 {
    font-family: var(--font-family-base);
    font-size: var(--font-size-lg);
}

.wrapper {
    align-items: stretch;
    display: flex;
    min-height: 100vh;
    width: 100%;
}

.main {
    display: flex;
    flex-direction: column;
    flex: 1;
    min-height: 100vh;
    min-width: 0;
    /* Body-scroll mode: let content grow the page and the window scroll.
       The viewport-locked exception is scoped to body.app-fixed (see style.css). */
    overflow: visible;
    transition: all 0.35s ease-in-out;
    background-color: var(--background);
    color: var(--text);
    width: 100%;
}

html[data-bs-theme="dark"]