html, body {
    font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif;
}

h1:focus {
    outline: none;
}

a, .btn-link {
    color: #0071c1;
}

.btn-primary {
    color: #fff;
    background-color: #1b6ec2;
    border-color: #1861ac;
}

.btn:focus, .btn:active:focus, .btn-link.nav-link:focus, .form-control:focus, .form-check-input:focus {
  box-shadow: 0 0 0 0.1rem white, 0 0 0 0.25rem #258cfb;
}

.content {
    padding-top: 1.1rem;
}

.valid.modified:not([type=checkbox]) {
    outline: 1px solid #26b050;
}

.invalid {
    outline: 1px solid red;
}

.validation-message {
    color: red;
}

#blazor-error-ui {
    color-scheme: light only;
    background: lightyellow;
    bottom: 0;
    box-shadow: 0 -1px 2px rgba(0, 0, 0, 0.2);
    box-sizing: border-box;
    display: none;
    left: 0;
    padding: 0.6rem 1.25rem 0.7rem 1.25rem;
    position: fixed;
    width: 100%;
    z-index: 1000;
}

    #blazor-error-ui .dismiss {
        cursor: pointer;
        position: absolute;
        right: 0.75rem;
        top: 0.5rem;
    }

.blazor-error-boundary {
    background: url(data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iNTYiIGhlaWdodD0iNDkiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIgeG1sbnM6eGxpbms9Imh0dHA6Ly93d3cudzMub3JnLzE5OTkveGxpbmsiIG92ZXJmbG93PSJoaWRkZW4iPjxkZWZzPjxjbGlwUGF0aCBpZD0iY2xpcDAiPjxyZWN0IHg9IjIzNSIgeT0iNTEiIHdpZHRoPSI1NiIgaGVpZ2h0PSI0OSIvPjwvY2xpcFBhdGg+PC9kZWZzPjxnIGNsaXAtcGF0aD0idXJsKCNjbGlwMCkiIHRyYW5zZm9ybT0idHJhbnNsYXRlKC0yMzUgLTUxKSI+PHBhdGggZD0iTTI2My41MDYgNTFDMjY0LjcxNyA1MSAyNjUuODEzIDUxLjQ4MzcgMjY2LjYwNiA1Mi4yNjU4TDI2Ny4wNTIgNTIuNzk4NyAyNjcuNTM5I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I2My41NzYgODYuMDU0N1oiIGZpbGw9IiNGRkU1MDAiIGZpbGwtcnVsZT0iZXZlbm9kZCIvPjwvZz48L3N2Zz4=) no-repeat 1rem/1.8rem, #b32121;
    padding: 1rem 1rem 1rem 3.7rem;
    color: white;
}

    .blazor-error-boundary::after {
        content: "An error has occurred."
    }

.loading-progress {
    position: absolute;
    display: block;
    width: 8rem;
    height: 8rem;
    inset: 20vh 0 auto 0;
    margin: 0 auto 0 auto;
}

    .loading-progress circle {
        fill: none;
        stroke: #e0e0e0;
        stroke-width: 0.6rem;
        transform-origin: 50% 50%;
        transform: rotate(-90deg);
    }

        .loading-progress circle:last-child {
            stroke: #1b6ec2;
            stroke-dasharray: calc(3.141 * var(--blazor-load-percentage, 0%) * 0.8), 500%;
            transition: stroke-dasharray 0.05s ease-in-out;
        }

.loading-progress-text {
    position: absolute;
    text-align: center;
    font-weight: bold;
    inset: calc(20vh + 3.25rem) 0 auto 0.2rem;
}

    .loading-progress-text:after {
        content: var(--blazor-load-percentage-text, "Loading");
    }

code {
    color: #c02d76;
}

.form-floating > .form-control-plaintext::placeholder, .form-floating > .form-control::placeholder {
    color: var(--bs-secondary-color);
    text-align: end;
}

.form-floating > .form-control-plaintext:focus::placeholder, .form-floating > .form-control:focus::placeholder {
    text-align: start;
}
/* ---- Responsive shell (issue 192) ----
   Cross-component layout rules live here because they span the layout, the sidebar and the pages.
   --bottom-inset is the space content keeps free at the bottom of small screens: the iOS home indicator (safe area); the
   layout and the chat read it. --header-space is the height the sticky top bar occupies (0 where the top bar
   scrolls away with the page); pages use it as scroll-margin-top, so that an anchor does not land under the top bar.
   --top-inset is the space the top bars keep free above their content: the safe area at the top (status bar, notch).
   --font-scale makes all type of the signed-in app about 7 % smaller than on the login and landing pages (brand.css
   sets 1); the base size covers text without a size of its own. Form fields keep 16px on small screens (iOS zoom). */
.app-shell {
    --bottom-inset: env(safe-area-inset-bottom, 0px);
    --header-space: 0px;
    --top-inset: env(safe-area-inset-top, 0px);
    --font-scale: 0.93;
    font-size: calc(16px * var(--font-scale));
}

/* Installed app (PWA) on iOS: since iOS 26 the system blurs a band of about 40 pt below the status bar (Liquid Glass
   scroll edge effect) that cannot be switched off from the page. The top bars keep their content out of it with extra
   space; on an iPhone the blur reached about 30 pt below the safe area: 24 px were not enough, 40 px left a visible
   gap, so 32 px is the compromise. The space does
   not depend on the reported safe area. -webkit-touch-callout limits it to iOS/iPadOS (not Android or desktop),
   portrait leaves phones in landscape (no status bar) unchanged. */
@supports (-webkit-touch-callout: none) {
    @media (display-mode: standalone) and (orientation: portrait) {
        .app-shell { --top-inset: calc(env(safe-area-inset-top, 0px) + 32px); }
    }
}

/* Below 1024 px the chat panel ends above the home indicator (--chat-bottom-inset, Chat.razor.css). While the on-screen
   keyboard is open (data-bb-keyboard, browser-api.js) the composer sits directly above the keyboard. */
.app-shell--chat { --chat-bottom-inset: var(--bottom-inset); }
:root[data-bb-keyboard] .app-shell--chat { --chat-bottom-inset: 0px; }

@media (max-width: 1023.98px) {
    /* Top bar of MainLayout.razor.css: min-height 56 px (or the logo plus padding where the notch makes the top padding larger), plus its 1 px border. */
    .app-shell { --header-space: calc(max(56px, max(8px, var(--top-inset)) + 8px + 32px) + 1px); }

    /* Large title (iOS style): the page h1 is big, bold and left-aligned. The id raises the specificity above page-scoped h1 rules.
       Chat pages keep their slim bar instead (Chat.razor.css). */
    .app-shell--navigation:not(.app-shell--chat) main#main-content h1 {
        font-size: calc(30px * var(--font-scale));
        font-weight: 800;
        letter-spacing: -0.02em;
        line-height: 1.15;
        text-align: left;
    }

    /* Chat: the page itself never scrolls or bounces, only the chat thread does (Chat.razor.css). */
    html:has(.chat-panel:not(.chat-panel--static)),
    html:has(.chat-panel:not(.chat-panel--static)) body {
        height: 100%;
        overflow: hidden;
        overscroll-behavior: none;
    }
}

/* Installed app (PWA) on small screens: no rubber-band effect that drags the sticky top bar away from the top. */
@media (display-mode: standalone) and (max-width: 1023.98px) {
    html { overscroll-behavior-y: none; }
}

/* ---- Streamed chat answers fade in word by word (issue 506, bbReveal in browser-api.js) ----
   Global because the word spans are created in the browser and carry no Blazor CSS scope. Only opacity changes, so the
   layout does not move. Sources and actions of an answer appear once its last word is visible. */
.bb-word--wait { opacity: 0; }
.bb-word--in { animation: bb-word-in 250ms ease-out both; }
@keyframes bb-word-in { from { opacity: 0; } }
[data-reveal-pending] :is(.chat-sources-label, .chat-source, .chat-source-link, .chat-sources-toggle, .chat-actions, .chat-backing--backed) { visibility: hidden; }
@media (prefers-reduced-motion: reduce) {
    .bb-word--wait { opacity: 1; }
    .bb-word--in { animation: none; }
}

/* ---- Module sections in the sidebar below the navigation (SidebarSections, e.g. the chat history #448) ----
   Global because the rule spans the scopes of MainLayout, NavMenu and SidebarSections: with sections the navigation keeps
   its height and the sections take the rest (their list scrolls), the account menu stays at the bottom. The extra
   .app-shell outweighs the scoped rule of MainLayout.razor.css, which loads later. On short or zoomed screens the sections
   keep a minimum height and the sidebar itself scrolls, so navigation and account menu stay reachable. */
@media (min-width: 1024px) {
    .app-shell .app-sidebar:has(> .app-sidebar-sections) > .app-nav { flex: none; }
}

/* While the menu of small screens is open (MainLayout, browser-api.js bbSidebarDrawer), the page does not scroll. */
@media (max-width: 1023.98px) {
    :root:has(.app-sidebar[data-open]) { overflow: hidden; }
}

/* Landing page: elements scrolled into view by Tab or anchors stay clear of the floating "Nach oben" link (LandingLayout). */
html:has(.landing-to-top) { scroll-padding-bottom: 76px; }
