h1:focus {
    outline: none;
}

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

.invalid {
    outline: 1px solid #e50000;
}

.validation-message {
    color: #e50000;
}

.blazor-error-boundary {
    background: url(data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iNTYiIGhlaWdodD0iNDkiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIgeG1sbnM6eGxpbms9Imh0dHA6Ly93d3cudzMub3JnLzE5OTkveGxpbmsiIG92ZXJmbG93PSJoaWRkZW4iPjxkZWZzPjxjbGlwUGF0aCBpZD0iY2xpcDAiPjxyZWN0IHg9IjIzNSIgeT0iNTEiIHdpZHRoPSI1NiIgaGVpZ2h0PSI0OSIvPjwvY2xpcFBhdGg+PC9kZWZzPjxnIGNsaXAtcGF0aD0idXJsKCNjbGlwMCkiIHRyYW5zZm9ybT0idHJhbnNsYXRlKC0yMzUgLTUxKSI+PHBhdGggZD0iTTI2My41MDYgNTFDMjY0LjcxNyA1MSAyNjUuODEzIDUxLjQ4MzcgMjY2LjYwNiA1Mi4yNjU4TDI2Ny4wNTIgNTIuNzk4NyAyNjcuNTM5IDUzLjYyODMgMjkwLjE4NSA5Mi4xODMxIDI5MC41NDUgOTIuNzk1IDI5MC42NTYgOTIuOTk2QzI5MC44NzcgOTMuNTEzIDI5MSA5NC4wODE1IDI5MSA5NC42NzgyIDI5MSA5Ny4wNjUxIDI4OS4wMzggOTkgMjg2LjYxNyA5OUwyNDAuMzgzIDk5QzIzNy45NjMgOTkgMjM2IDk3LjA2NTEgMjM2IDk0LjY3ODIgMjM2IDk0LjM3OTkgMjM2LjAzMSA5NC4wODg2IDIzNi4wODkgOTMuODA3MkwyMzYuMzM4IDkzLjAxNjIgMjM2Ljg1OCA5Mi4xMzE0IDI1OS40NzMgNTMuNjI5NCAyNTkuOTYxIDUyLjc5ODUgMjYwLjQwNyA1Mi4yNjU4QzI2MS4yIDUxLjQ4MzcgMjYyLjI5NiA1MSAyNjMuNTA2IDUxWk0yNjMuNTg2IDY2LjAxODNDMjYwLjczNyA2Ni4wMTgzIDI1OS4zMTMgNjcuMTI0NSAyNTkuMzEzIDY5LjMzNyAyNTkuMzEzIDY5LjYxMDIgMjU5LjMzMiA2OS44NjA4IDI1OS4zNzEgNzAuMDg4N0wyNjEuNzk1IDg0LjAxNjEgMjY1LjM4IDg0LjAxNjEgMjY3LjgyMSA2OS43NDc1QzI2Ny44NiA2OS43MzA5IDI2Ny44NzkgNjkuNTg3NyAyNjcuODc5IDY5LjMxNzkgMjY3Ljg3OSA2Ny4xMTgyIDI2Ni40NDggNjYuMDE4MyAyNjMuNTg2IDY2LjAxODNaTTI2My41NzYgODYuMDU0N0MyNjEuMDQ5IDg2LjA1NDcgMjU5Ljc4NiA4Ny4zMDA1IDI1OS43ODYgODkuNzkyMSAyNTkuNzg2IDkyLjI4MzcgMjYxLjA0OSA5My41Mjk1IDI2My41NzYgOTMuNTI5NSAyNjYuMTE2IDkzLjUyOTUgMjY3LjM4NyA5Mi4yODM3IDI2Ny4zODcgODkuNzkyMSAyNjcuMzg3IDg3LjMwMDUgMjY2LjExNiA4Ni4wNTQ3IDI2My41NzYgODYuMDU0N1oiIGZpbGw9IiNGRkU1MDAiIGZpbGwtcnVsZT0iZXZlbm9kZCIvPjwvZz48L3N2Zz4=) no-repeat 1rem/1.8rem, #b32121;
    padding: 1rem 1rem 1rem 3.7rem;
    color: white;
}

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

.darker-border-checkbox.form-check-input {
    border-color: #929292;
}

.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;
}

/* Chat transcript
   The bubbles use the MudBlazor theme variables instead of fixed colours so the chat follows the
   light and dark palette without a second definition. */
.atlas-chat-bubble {
    border-radius: 1rem;
    word-break: break-word;
}

.atlas-chat-bubble-user {
    background-color: var(--mud-palette-info);
    color: var(--mud-palette-info-text);
    border-bottom-right-radius: 0.25rem;
}

.atlas-chat-bubble-assistant {
    background-color: var(--mud-palette-background-gray);
    color: var(--mud-palette-text-primary);
    border: 1px solid var(--mud-palette-lines-default);
    border-bottom-left-radius: 0.25rem;
}

/* Directives such as @Knowledge stay readable as a badge inside the coloured question bubble. */
.atlas-mention {
    display: inline-block;
    padding: 0 0.4rem;
    border-radius: 0.75rem;
    font-weight: 600;
    background-color: rgba(255, 255, 255, 0.25);
    white-space: nowrap;
}

/* Markdown produced by the assistant. Rendered HTML carries no classes, so the elements are
   styled by tag inside the answer container only. */
.atlas-markdown > *:first-child {
    margin-top: 0;
}

.atlas-markdown > *:last-child {
    margin-bottom: 0;
}

.atlas-markdown p {
    margin: 0 0 0.75rem;
    line-height: 1.6;
}

.atlas-markdown h1,
.atlas-markdown h2,
.atlas-markdown h3,
.atlas-markdown h4 {
    margin: 1rem 0 0.5rem;
    font-weight: 600;
    line-height: 1.3;
}

.atlas-markdown h1 { font-size: 1.35rem; }
.atlas-markdown h2 { font-size: 1.2rem; }
.atlas-markdown h3 { font-size: 1.05rem; }
.atlas-markdown h4 { font-size: 1rem; }

.atlas-markdown ul,
.atlas-markdown ol {
    margin: 0 0 0.75rem;
    padding-left: 1.5rem;
}

.atlas-markdown li {
    margin-bottom: 0.25rem;
}

.atlas-markdown code {
    background-color: var(--mud-palette-action-default-hover);
    border-radius: 0.25rem;
    padding: 0.1rem 0.3rem;
    font-family: ui-monospace, SFMono-Regular, Consolas, monospace;
    font-size: 0.875em;
}

.atlas-markdown pre {
    background-color: var(--mud-palette-action-default-hover);
    border-radius: 0.5rem;
    padding: 0.75rem;
    overflow-x: auto;
    margin: 0 0 0.75rem;
}

.atlas-markdown pre code {
    background: none;
    padding: 0;
}

.atlas-markdown blockquote {
    margin: 0 0 0.75rem;
    padding-left: 0.75rem;
    border-left: 3px solid var(--mud-palette-primary);
    color: var(--mud-palette-text-secondary);
}

.atlas-markdown table {
    border-collapse: collapse;
    width: 100%;
    margin-bottom: 0.75rem;
}

.atlas-markdown th,
.atlas-markdown td {
    border: 1px solid var(--mud-palette-lines-default);
    padding: 0.35rem 0.5rem;
    text-align: left;
}

.atlas-markdown a {
    color: var(--mud-palette-primary);
}

/* Technical identifiers and pasted columns. A tenant key differing from another one by a single
   character is unreadable in a proportional font, and a pasted list stops lining up in one. */
.atlas-monospace,
.atlas-monospace input,
.atlas-monospace textarea {
    font-family: ui-monospace, SFMono-Regular, Consolas, monospace;
}

/* A raw payload in a dialog: it has to be readable without pushing the dialog wider than the
   screen, so it wraps and scrolls instead of stretching. */
.atlas-payload {
    margin: 0;
    max-height: 20rem;
    overflow: auto;
    white-space: pre-wrap;
    word-break: break-word;
    font-size: 0.8125rem;
    background-color: var(--mud-palette-background-gray);
    border-radius: 0.25rem;
    padding: 0.75rem;
}

/* An agent card says which system it belongs to three times over: the icon, the chip and the word
   behind it. Three, because none of them works for everybody — the colour alone is useless to a
   reader who cannot separate two hues, and the chip alone is missed when a list is scanned rather
   than read. The word is a texture and not a label: at this opacity it identifies a card from
   across the screen and never competes with the name of the agent, which is the thing somebody is
   actually looking for. */
.atlas-agent-card {
    position: relative;
    overflow: hidden;
}

/* Lifts the real content over the wordmark. Without it the word would paint on top of the text it
   is meant to sit behind. */
.atlas-agent-card > * {
    position: relative;
    z-index: 1;
}

.atlas-agent-card::after {
    content: attr(data-kind);
    position: absolute;
    right: -0.75rem;
    bottom: -1.5rem;
    z-index: 0;
    font-size: 4.5rem;
    font-weight: 800;
    line-height: 1;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    transform: rotate(-10deg);
    color: rgba(var(--atlas-kind), 0.16);
    pointer-events: none;
    user-select: none;
}

/* Below the width where two columns of cards still hold their content, the wordmark is the first
   thing to go: on a phone it would take the space the card needs. */
@media (max-width: 599.98px) {
    .atlas-agent-card::after {
        display: none;
    }
}

/* A chart's date axis keeps every label where it has room, every second one below 640px and every
   fourth below 320px. Measured on the chart, not the window: the same chart sits in a full-width
   card and in a third of a row, and in the third ten dates overlapped into one unreadable string.
   Hidden rather than removed, so the labels left keep their place under their columns. The widths
   leave a week's label ("KW 29.09.") room at a year of weekly columns, the longest axis there is. */
.atlas-axis {
    container-type: inline-size;
}

@container (max-width: 640px) {
    .atlas-axis-half {
        visibility: hidden;
    }
}

@container (max-width: 320px) {
    .atlas-axis-quarter {
        visibility: hidden;
    }
}
