/* ============================================================
           THEME TOKENS — Dark default, light via html[data-theme="light"]
           ============================================================ */
        html,
        body {
            --bw-yellow: #fffc00;
            --bw-black: #2a2623;
            --bw-grey-6: #47403c;
            --bw-grey-5: #6d6766;
            --bw-grey-4: #918c8c;
            --bw-grey-3: #bbb6b5;
            --bw-grey-2: #e4e0e0;
            --bw-grey-1: #f4f3f3;
            --bw-white: #ffffff;
            --bw-focus: #6b108c;
            --font-sans: "BaWue Sans", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
            --font-serif: "BaWue Serif", "Cormorant Garamond", Georgia, serif;
            --main-color: var(--bw-yellow);
            --sec-color: #1e1e1e;
            --bg-color: #252525;
            --surface: #2a2a2a;
            --surface-hover: #333;
            --border: #3a3a3a;
            --border-light: #444;
            --text-primary: #e0e0e0;
            --text-secondary: #999;
            --text-muted: #777;
            --link-color: #ffef00;
            --link-hover: #d6c900;
            --content-link-color: var(--link-color);
            --content-link-weight: 700;
            --content-link-border: currentColor;
            --content-link-hover-bg: transparent;
            --content-link-hover-color: var(--link-hover);
            --content-link-hover-border: currentColor;
            --nav-bg: linear-gradient(180deg, rgba(40, 40, 40, 0.94) 0%, rgba(30, 30, 30, 0.92) 100%);
            --nav-border: rgba(255, 255, 255, 0.08);
            --nav-shadow: rgba(0, 0, 0, 0.25);
            --control-bg: #1d1d1d;
            --control-bg-hover: #202020;
            --control-border: rgba(255, 255, 255, 0.06);
            --control-border-hover: rgba(255, 255, 255, 0.1);
            --sidebar-bg: #242424;
            --sidebar-card: #2c2c2c;
            --sidebar-card-hover: #313131;
            --sidebar-card-active: #363636;
            --chat-input-bg: rgba(30, 30, 30, 0.95);
            --code-block-bg: #1a1a1a;
            --warning-bg: #2a2500;
            --danger-bg: rgba(140, 36, 36, 0.18);
            --danger-bg-hover: rgba(170, 42, 42, 0.28);
            --danger-border: #7b3434;
            --danger-border-hover: #a24a4a;
            --danger-text: #ffb9b9;
            --danger-text-hover: #ffd1d1;
            scrollbar-gutter: stable;
        }

        html[data-theme="light"],
        html[data-theme="light"] body {
            color-scheme: light;
            --main-color: var(--bw-yellow);
            --sec-color: var(--bw-grey-1);
            --bg-color: var(--bw-grey-2);
            --surface: var(--bw-white);
            --surface-hover: var(--bw-grey-1);
            --border: var(--bw-grey-2);
            --border-light: var(--bw-grey-3);
            --text-primary: var(--bw-black);
            --text-secondary: var(--bw-grey-5);
            --text-muted: var(--bw-grey-4);
            --link-color: var(--bw-black);
            --link-hover: var(--bw-black);
            --content-link-color: var(--bw-black);
            --content-link-border: var(--bw-grey-6);
            --content-link-hover-bg: var(--bw-black);
            --content-link-hover-color: var(--bw-yellow);
            --content-link-hover-border: var(--bw-black);
            --nav-bg: linear-gradient(180deg, rgba(255, 255, 255, 0.78) 0%, rgba(244, 243, 243, 0.66) 100%);
            --nav-border: rgba(42, 38, 35, 0.12);
            --nav-shadow: rgba(42, 38, 35, 0.12);
            --control-bg: var(--bw-white);
            --control-bg-hover: var(--bw-grey-1);
            --control-border: var(--bw-grey-2);
            --control-border-hover: var(--bw-grey-3);
            --sidebar-bg: var(--bw-grey-1);
            --sidebar-card: var(--bw-white);
            --sidebar-card-hover: var(--bw-grey-1);
            --sidebar-card-active: var(--bw-grey-2);
            --chat-input-bg: rgba(244, 243, 243, 0.94);
            --code-block-bg: var(--bw-grey-1);
            --warning-bg: #fffccc;
            --danger-bg: rgba(154, 48, 48, 0.08);
            --danger-bg-hover: rgba(154, 48, 48, 0.13);
            --danger-border: #c98c8c;
            --danger-border-hover: #b96e6e;
            --danger-text: #8c2f2f;
            --danger-text-hover: #6f2020;
        }

        /* --- Typography & Base --- */
        body {
            font-family: var(--font-sans);
            font-size: 16px;
            line-height: 1.6;
            -webkit-font-smoothing: antialiased;
            -moz-osx-font-smoothing: grayscale;
            background-color: var(--sec-color) !important;
            color: var(--text-primary) !important;
            overflow-y: scroll;
            transition: background-color 0.18s ease, color 0.18s ease;
        }

        /* Global text color resets for dark mode */
        h1, h2, h3, h4, h5, h6 {
            color: var(--text-primary) !important;
        }

        p {
            color: var(--text-primary);
        }

        a {
            color: var(--link-color, var(--main-color));
        }

        a:hover {
            color: var(--link-hover);
        }

        :where(.content-link, .text_box a, .hinweis a, .source-data-box a, .chat-intro-content .textlink a, .chat-text a, .answer-content a:not(.source-ref)) {
            border-bottom: 2px solid var(--content-link-border);
            color: var(--content-link-color) !important;
            font-weight: var(--content-link-weight);
            padding: 0 2px;
            text-decoration: none;
            text-underline-offset: 0.23em;
        }

        :where(.content-link, .text_box a, .hinweis a, .source-data-box a, .chat-intro-content .textlink a, .chat-text a, .answer-content a:not(.source-ref)):hover {
            background: var(--content-link-hover-bg);
            border-bottom-color: var(--content-link-hover-border);
            color: var(--content-link-hover-color) !important;
        }

        html[data-theme="light"] a:focus-visible {
            outline: 2px solid var(--bw-focus);
            outline-offset: 4px;
        }

        /* Text box heading styles for legal/info pages */
        .text_box h2 {
            font-size: 1.4rem;
            font-weight: 700;
            line-height: 1.5;
            margin-top: 2.5rem;
            margin-bottom: 1rem;
        }

        @media screen and (max-width: 500px) {
            .text_box h2 {
                font-size: 1.2rem;
                margin-top: 2rem;
            }
        }

        /* Popup content left-aligned for UniMA consent popup */
        .pop_up_content {
            text-align: left;
        }

        /* Hinweis block display on mobile */
        @media screen and (max-width: 742px) {
            .hinweis {
                display: block;
            }
        }

        /* ============================================================
           TEXT PAGES (Impressum, Datenschutz, Nutzungsbedingungen)
           ============================================================ */
        .main-text-container {
            color: var(--text-primary) !important;
        }

        .text_box {
            color: var(--text-primary) !important;
        }

        .text_box p,
        .text_box li,
        .text_box span,
        .text_box h1,
        .text_box h2,
        .text_box h3,
        .text_box h4,
        .text_box h5,
        .text_box h6 {
            color: var(--text-primary) !important;
        }

        .terms_container {
            color: var(--text-primary) !important;
        }

        /* ============================================================
           MOBILE — Responsive adjustments
           ============================================================ */
        @media screen and (max-width: 905px) {
            nav,
            nav.navbar {
                background: var(--sec-color) !important;
                background-color: var(--sec-color) !important;
            }
        }

        @media screen and (max-width: 640px) {
            .chat-page-container {
                padding-top: 120px !important;
                padding-bottom: 300px !important;
                padding-left: 12px;
                padding-right: 12px;
            }

            .chat-content-wrapper > div:has(.chat-icon-user) {
                padding: 12px 14px !important;
                border-radius: 12px;
                margin-left: 30px !important;
            }

            .chat-content-wrapper > div:has(.chat-icon-assistant) {
                padding-right: 30px !important;
            }

            .chat-eingabe {
                border-radius: 12px !important;
            }

            .chat-input-container {
                padding: 12px 12px calc(12px + env(safe-area-inset-bottom)) !important;
                bottom: 108px !important;
            }
        }

        /* ============================================================
           PAGE-SPECIFIC STYLES
           ============================================================ */
        html,
        body {
            height: 100%;
            margin: 0;
            overflow-x: hidden;
        }

        .main-text-container {
            margin: 0 auto;
            text-align: left;
            display: grid;
            padding-top: 20px;
            padding-bottom: 20px;
            width: min(700px, calc(100vw - 196px)); /* 100px narrower */
            max-width: 700px;
        }

        .terms_container {
            color: var(--text-primary);
        }

        .terms_container h4.svelte-n3h660,
        .terms_container h4.title {
            font-family: "MainFont_Bold", Arial, Helvetica, sans-serif;
            letter-spacing: 0.25px;
            font-weight: 700;
            font-size: 32px;
            margin-top: 25px;
            margin-bottom: 30px;
            line-height: 1.18;
            text-align: left;
            white-space: break-spaces;
            width: 100%;
        }

        .text_box {
            padding: 0;
            margin-bottom: 50px;
            margin-top: 25px;
            width: 100%;
            max-width: 1000px;
        }

        .text_box p,
        .text_box li,
        .text_box span,
        .text_box h1,
        .text_box h2,
        .text_box h3,
        .text_box h4,
        .text_box h5,
        .text_box h6 {
            color: var(--text-primary) !important;
        }

        .text_box h2 {
            font-family: "MainFont_Bold", Arial, Helvetica, sans-serif;
            letter-spacing: -0.5px;
            font-size: 1.1rem;
            line-height: 1.5;
            margin-top: 2.5rem;
            margin-bottom: 1rem;
        }

        .text_box p {
            margin-bottom: 12px;
            font-size: 0.75rem; /* slightly smaller for Impressum */
        }

        .text_box li {
            font-size: 0.8rem;
        }

        /* Impressum: keep links visually neutral — no hover color change or bolding */
        .text_box a,
        .text_box a:visited {
            font-weight: 400;
            color: var(--link-color) !important;
            text-decoration: none;
            border-bottom: none;
        }

        .text_box a:hover,
        .text_box a:focus,
        .text_box a:focus-visible {
            font-weight: 700;
            color: inherit !important;
            background: none !important;
            border-bottom-color: transparent !important;
            text-decoration: none !important;
        }

        p {
            text-transform: none;
            padding-top: 10px;
            font-size: 0.8rem;
        }

        blockquote, dl, dd, h1, h2, h3, h4, h5, h6, hr, figure, p, pre {
            margin: 0;
        }

        /* Footer styles from index.html */
        .site-footer {
            position: relative;
            margin-top: 0;
            padding: 10px 18px;
            margin-inline: calc(var(--page-x-pad) * -1);
            width: calc(100% + (var(--page-x-pad) * 2));
            background: #1e1e1e;
            border-top: none;
            color: rgba(255, 255, 255, 0.72);
            display: grid;
            grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
            align-items: center;
            min-height: 54px;
            font-size: 0.82rem;
            text-align: center;
        }

        .site-footer::before {
            content: none;
        }

        .footer-brand {
            display: flex;
            flex-direction: column;
            justify-content: center;
            gap: 2px;
            line-height: 1.2;
            white-space: nowrap;
            align-items: center;
            grid-column: 1;
            justify-self: start;
            align-self: center;
            height: 100%;
        }

        .footer-brand a,
        .footer-links a {
            color: inherit;
            text-decoration: none;
            border: 1px solid transparent;
            border-radius: 6px;
            padding: 2px 6px;
            transition: background-color 0.18s ease, border-color 0.18s ease, color 0.18s ease;
        }

        .footer-links a:hover,
        .footer-links a:focus-visible {
            color: #ffffff;
            background: transparent;
            border-color: transparent;
	        transform: none;
            text-decoration: none;
        }

        .footer-links {
            display: flex;
            align-items: center;
            justify-content: center;
            gap: 16px;
            flex-wrap: wrap;
            text-align: center;
            grid-column: 2;
        }

        .footer-links span {
            color: rgba(255, 255, 255, 0.36);
        }

        @media (max-width: 760px) {
            .site-footer {
                margin-inline: -12px;
                width: calc(100% + 24px);
            }

            .footer-brand {
                font-size: 0.75rem;
            }

            .footer-links {
                gap: 12px;
            }
        }

        /* Sponsor section styles from index.html */
        .sponsors-section {
            margin-top: 0;
            margin-bottom: 0;
            padding: 10px clamp(14px, 4vw, 28px);
            padding-bottom: 0;
            margin-inline: calc(var(--page-x-pad) * -1);
            width: calc(100% + (var(--page-x-pad) * 2));
            background: #1e1e1e;
            border-top: none;
            border-bottom: 0.5px solid rgba(255, 255, 255, 0.06);
            display: grid;
            grid-template-columns: auto auto;
            justify-content: center;
            gap: 80px;
            align-items: center;
            justify-items: center;
            min-height: 64px;
        }

        .sponsor-column {
            display: flex;
            align-items: center;
            gap: 8px;
            justify-content: center;
            flex-wrap: wrap;
        }

        .sponsor-label {
            color: rgba(255, 255, 255, 0.72);
            font-size: 0.85rem;
            font-weight: 600;
            letter-spacing: 0.01em;
            white-space: nowrap;
        }

        .sponsor-logo {
            height: 45px;
            object-fit: contain;
            filter: brightness(0.95);
        }

        @media (max-width: 760px) {
            .sponsors-section {
                grid-template-columns: 1fr;
                gap: 16px;
                padding: 16px 14px;
                min-height: auto;
            }

            .sponsor-column {
                flex-direction: column;
                gap: 10px;
            }

            .sponsor-label {
                font-size: 0.8rem;
            }

            .sponsor-logo {
                height: 40px;
            }
        }

        /* Responsive design for mobile */
        @media (max-width: 768px) {
            .main-text-container {
                width: min(100%, calc(100vw - 32px));
                padding-top: 15px;
                padding-bottom: 15px;
            }

            .terms_container h4.svelte-n3h660,
            .terms_container h4.title {
                font-size: 24px;
                margin-top: 20px;
                margin-bottom: 20px;
            }

            .text_box h2 {
                font-size: 1rem;
                margin-top: 1.5rem;
                margin-bottom: 0.6rem;
            }

            .text_box p,
            .text_box li,
            p {
                font-size: 0.75rem;
                margin-bottom: 6px;
            }
        }

        @media (max-width: 480px) {
            .main-text-container {
                width: 100%;
                padding-top: 12px;
                padding-bottom: 12px;
            }

            .terms_container h4.svelte-n3h660,
            .terms_container h4.title {
                font-size: 20px;
                margin-top: 15px;
                margin-bottom: 15px;
            }

            .text_box h2 {
                font-size: 0.95rem;
                margin-top: 1.2rem;
                margin-bottom: 0.5rem;
            }

            .text_box p,
            .text_box li,
            p {
                font-size: 0.7rem;
                margin-bottom: 5px;
            }
        }
