/* Tokens that are the same in both themes */
:root {
    /* Discord Brand Colors */
    --color-discord: #5865F2DD;
    --color-discord-hover: #6373EDDD;
    /* Ko-fi Brand Colors */
    --color-kofi: #FF4F19DD;
    --color-kofi-hover: #FF6433DD;
    --color-kofi-open: #FF8966DD;
    /* Blue Button Variant Colors */
    --color-blue: #1E72CCDD;
    --color-blue-hover: #2B7FD4DD;
    --color-blue-active: #3A8CDDDD;
    /* Yellow Button Variant Colors */
    --color-yellow: #FFCC11AA;
    --color-yellow-hover: #FFD633BB;
    --color-yellow-active: #FFE055BB;
    /* Red Button Variant Colors */
    --color-button-red: #CC3D3D;
    --color-button-red-hover: #FF6666DD;
    --color-button-red-active: #FF7777DD;
    /* Upload Drop Zone Tags */
    --color-tag-gbx-bg: #257A;
    --color-tag-other-bg: #642A;
    /* Shadows */
    --shadow-modal: 0 24px 64px #0009, 0 4px 16px #0004;
    --shadow-popover: 0 18px 38px #0006, 0 4px 14px #0003;
    /* Fonts */
    --font-mono: "Chivo Mono";
}

:root,
[data-theme="dark"],
.reu-theme-dark {
    color-scheme: dark;
    --color-scheme: dark;
    /* Surfaces & backgrounds */
    --color-bg: #111;
    --color-surface: #222;
    --color-surface-hover: #333;
    --color-surface-active: #444;
    --color-overlay-bg: #111D;
    --color-surface-secondary: #1A1A1A;
    /* Deprecated alias; use --color-surface-secondary instead. */
    --color-footer-bg: var(--color-surface-secondary);
    /* Text */
    --color-text-primary: #FFF;
    --color-text-secondary: #AAA;
    --color-text-muted: #666;
    /* Borders */
    --color-border: #333;
    --color-border-subtle: #3338;
    --color-border-strong: #555;
    /* Decorative / surface overlays (subtle lightening on dark) */
    --color-overlay-weak: #AAA1;
    --color-overlay-medium: #FFF2;
    --color-overlay-strong: #FFF5;
    /* Spinner / loader fill */
    --color-loader: #FFF;
    /* Scrollbar */
    --color-scrollbar-thumb: #555;
    /* Link Colors */
    --color-link: #4CB7FF;
    --color-link-hover: #66C1FF;
    /* Button Colors */
    --color-button-bg: #2228;
    --color-button-bg-hover: #333A;
    --color-button-bg-active: #333C;
    --color-button-bg-disabled: #3334;
    --color-button-border: #FFF3;
    /* Navigation Colors */
    --color-nav-bg: #111;
    --color-nav-item-bg: #3333;
    --color-nav-item-hover: #3338;
    --color-nav-item-active: #555A;
    --color-nav-border: #FFF3;
    /* Input Colors */
    --color-input-border: #333;
    --color-input-border-hover: #444;
    --color-input-bg: #1A1A1A;
    --color-input-bg-hover: #222;
    --color-input-bg-disabled: #282828;
    /* Tooltip Colors */
    --color-tooltip-bg: #3338;
    --color-tooltip-text: #FFF;
    --color-tooltip-border: #FFF2;
    /* Modal Colors */
    --color-modal-bg: #111C;
    --color-modal-surface: #181818;
    --color-modal-button-bg: #222;
    /* Object Tree Colors */
    --color-object-tree-box-bg: #222;
    --color-object-tree-box: #2224;
    --color-object-tree-box-value: #2228;
    /* Upload Drop Zone Colors */
    --color-dropzone-border: #FFF5;
    --color-dropzone-bg: #FFF1;
    --color-dropzone-bg-hover: #FFF2;
    --color-dropzone-text: #AAA;
    --color-dropzone-note: #666;
    --color-tag-text: #DDD;
    /* Friendly Type (syntax) Colors */
    --color-syntax-keyword: #59B9FF;
    --color-syntax-enum: #DBFFC1;
    --color-syntax-struct: #63FFFF;
    --color-syntax-class: #5BFFDE;
    --color-syntax-generic: #B8D7A3;
    --color-syntax-interface: #B6D7A3;
    /* Control fill (checkbox / radio mark) */
    --color-control-mark: #FFF;
    /* Validation Colors */
    --color-red: #FF4C4C;
    --color-green: #42DC54;
}

[data-theme="light"],
.reu-theme-light {
    color-scheme: light;
    --color-scheme: light;
    /* Surfaces & backgrounds */
    --color-bg: #F4F4F5;
    --color-surface: #FFF;
    --color-surface-hover: #E9E9EC;
    --color-surface-active: #DCDCE1;
    --color-overlay-bg: #FFFFFFEE;
    --color-surface-secondary: #EEE;
    /* Deprecated alias; use --color-surface-secondary instead. */
    --color-footer-bg: var(--color-surface-secondary);
    /* Text */
    --color-text-primary: #1A1A1A;
    --color-text-secondary: #444;
    --color-text-muted: #999;
    /* Borders */
    --color-border: #CCC;
    --color-border-subtle: #0000001A;
    --color-border-strong: #AAA;
    /* Decorative / surface overlays (subtle darkening on light) */
    --color-overlay-weak: #0000000A;
    --color-overlay-medium: #00000014;
    --color-overlay-strong: #00000033;
    /* Spinner / loader fill */
    --color-loader: #333;
    /* Scrollbar */
    --color-scrollbar-thumb: #BBB;
    /* Link Colors */
    --color-link: #1565C0;
    --color-link-hover: #1E88E5;
    /* Button Colors */
    --color-button-bg: #FFFFFFAA;
    --color-button-bg-hover: #FFFFFF;
    --color-button-bg-active: #EDEDED;
    --color-button-bg-disabled: #00000010;
    --color-button-border: #00000026;
    /* Navigation Colors */
    --color-nav-bg: #FAFAFA;
    --color-nav-item-bg: #00000006;
    --color-nav-item-hover: #0000000A;
    --color-nav-item-active: #00000026;
    --color-nav-border: #00000026;
    /* Input Colors */
    --color-input-border: #CCC;
    --color-input-border-hover: #999;
    --color-input-bg: #FFF;
    --color-input-bg-hover: #F4F4F5;
    --color-input-bg-disabled: #EBEBEB;
    /* Tooltip Colors */
    --color-tooltip-bg: #222222E6;
    --color-tooltip-text: #FFF;
    --color-tooltip-border: #FFF2;
    /* Modal Colors */
    --color-modal-bg: #FFFFFFCC;
    --color-modal-surface: #F0F0F2;
    --color-modal-button-bg: #FFFFFFAA;
    /* Object Tree Colors */
    --color-object-tree-box-bg: #E9E9EC;
    --color-object-tree-box: #00000004;
    --color-object-tree-box-value: #00000012;
    /* Upload Drop Zone Colors */
    --color-dropzone-border: #00000033;
    --color-dropzone-bg: #0000000A;
    --color-dropzone-bg-hover: #00000014;
    --color-dropzone-text: #555;
    --color-dropzone-note: #999;
    --color-tag-text: #222;
    /* Friendly Type (syntax) Colors */
    --color-syntax-keyword: #0033B3;
    --color-syntax-enum: #267F2A;
    --color-syntax-struct: #008080;
    --color-syntax-class: #267F99;
    --color-syntax-generic: #3E7C2A;
    --color-syntax-interface: #3E7C2A;
    /* Control fill (checkbox / radio mark) */
    --color-control-mark: #1565C0;
    /* Validation Colors */
    --color-red: #D32F2F;
    --color-green: #2E7D32;
}

@font-face {
    font-family: "Rubik";
    src: url('Rubik-VariableFont_wght.ttf');
}

@font-face {
    font-family: "Chivo Mono";
    src: url('ChivoMono-VariableFont_wght.ttf');
}

html, body {
    font-family: "Rubik";
    font-optical-sizing: auto;
    font-style: normal;
    margin: 0;
    padding: 0;
    font-size: 18px;
    color: var(--color-text-primary);
    background-color: var(--color-bg);
    transition: background-color 0.2s ease, color 0.2s ease;
}

body {
    overflow-x: hidden;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

button, input[type=submit], input[type=button] {
    all: unset;
}

/* unsetting them above also takes away their focus ring, which keyboard users need to see where they are */
:where(button, input[type=submit], input[type=button]):focus-visible {
    outline: 2px solid var(--color-link);
    outline-offset: 2px;
}

a {
    color: var(--color-link);
    text-decoration: none;
}

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

.reu-container {
    padding: 1rem;
    width: 75%;
    margin-right: auto;
    margin-left: auto;
    transition: width 0.2s ease, padding 0.2s ease;
}

main.reu-main {
    flex: 1;
}

@media (max-width: 850px) {
    .reu-container {
        width: calc(100% - 3rem);
    }
}

.reu-discord {
    background-color: var(--color-discord) !important;
}

    .reu-discord:hover {
        background-color: var(--color-discord-hover) !important;
    }

.reu-nuget {
    background-color: var(--color-blue) !important;
}

    .reu-nuget:hover {
        background-color: var(--color-blue-hover) !important;
    }

.reu-kofi {
    background-color: var(--color-kofi) !important;
    cursor: pointer;
}

    .reu-kofi:hover {
        background-color: var(--color-kofi-hover) !important;
    }

    .reu-kofi.open {
        background-color: var(--color-kofi-open) !important;
    }



.reu-button, input[type=submit], input[type=button] {
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--color-text-primary);
    background: var(--color-button-bg);
    border-bottom: 2px solid var(--color-button-border);
    border-radius: 4px;
    text-decoration: none;
    transition: background-color 0.05s ease, color 0.05s ease;
    padding: 10px 5px;
    cursor: pointer;
}

    .reu-button:hover, input[type=submit]:hover, input[type=button]:hover {
        background-color: var(--color-button-bg-hover);
        color: var(--color-text-primary);
        text-decoration: none;
    }

    .reu-button.active {
        background-color: var(--color-button-bg-active);
    }

    .reu-button.disabled, .reu-button:disabled, input[type=submit]:disabled, input[type=button]:disabled {
        background-color: var(--color-button-bg-disabled);
        color: var(--color-text-secondary);
        cursor: not-allowed;
    }

.reu-button-blue {
    background-color: var(--color-blue);
    color: #FFF;
}

    .reu-button-blue:hover:not(:disabled, .disabled) {
        background-color: var(--color-blue-hover);
        color: #FFF;
    }

    .reu-button-blue.active {
        background-color: var(--color-blue-active);
        color: #FFF;
    }

.reu-button-yellow {
    background-color: var(--color-yellow);
}

    .reu-button-yellow:hover:not(:disabled, .disabled) {
        background-color: var(--color-yellow-hover);
    }

    .reu-button-yellow.active {
        background-color: var(--color-yellow-active);
    }

.reu-button-red {
    background-color: var(--color-button-red);
    color: #FFF;
}

    .reu-button-red:hover:not(:disabled, .disabled) {
        background-color: var(--color-button-red-hover);
        color: #FFF;
    }

    .reu-button-red.active {
        background-color: var(--color-button-red-active);
        color: #FFF;
    }

.reu-button img {
    transition: filter 0.2s ease;
}

/* In the light theme, icons inside plain buttons are white SVGs designed for
   dark backgrounds — invert them so they are visible on the light surface. */
:is([data-theme="light"], .reu-theme-light) .reu-button img {
    filter: invert(1);
}

/* Colored-variant buttons keep their dark backgrounds so they are excluded. */
:is([data-theme="light"], .reu-theme-light) :is(.reu-button-blue, .reu-button-yellow, .reu-button-red,
                                              .reu-discord, .reu-kofi, .reu-nuget) img {
    filter: none;
}

.reu-upload-button {
    position: relative;
}

    .reu-upload-button input {
        position: absolute;
        top: 0;
        width: 100%;
        height: calc(100% + 3px);
        cursor: pointer;
        opacity: 0;
    }

    .reu-upload-button.disabled input {
        cursor: not-allowed;
    }

    /* the input takes the focus, but it cannot be seen */
    .reu-upload-button:has(input:focus-visible) {
        outline: 2px solid var(--color-link);
        outline-offset: 2px;
    }

.reu-center {
    display: flex;
    flex-direction: column;
    align-items: center;
}

.reu-overflow {
    overflow-x: auto;
}

.reu-list {
    display: flex;
}

    .reu-list .reu-list-item {
        display: flex;
        border-radius: 5px;
        justify-content: center;
    }

    .reu-list.grow .reu-list-item {
        flex: 1;
    }

        .reu-list .reu-list-item:hover {
            background-color: var(--color-surface-hover);
            cursor: pointer;
        }

        .reu-list .reu-list-item.active {
            background-color: var(--color-surface-active);
        }

    .reu-list.panel {
        background-color: var(--color-input-bg);
        border: 1px solid var(--color-border);
        border-radius: 5px;
        transition: background-color 0.2s ease;
    }

    .reu-list.vertical {
        flex-direction: column;
        overflow: auto;
    }

    .reu-list.wrap {
        flex-flow: wrap;
    }

.reu-document {
    max-width: 800px;
    line-height: 1.6;
    margin-bottom: 2rem;
}

    .reu-document .last-updated {
        font-style: italic;
        font-size: 0.9em;
        margin-bottom: 2rem;
        border-left: 3px solid var(--color-border);
        padding-left: 1rem;
    }

    .reu-document h2 {
        margin-top: 2.5rem;
        margin-bottom: 1rem;
    }

    .reu-document ul {
        margin-bottom: 1rem;
        padding-left: 1.5rem;
    }

    .reu-document li {
        margin-bottom: 0.5rem;
    }

select {
    cursor: pointer;
}

/* The input lists are kept as input:is(...), so that they stay as specific as input[type=text]. */
select,
input:is(:not([type]), .text, [type=text], [type=password], [type=search],
         [type=url], [type=tel], [type=email], [type=number], [type=color],
         [type=date], [type=datetime-local], [type=time], [type=month], [type=week]) {
    border: 1px solid var(--color-input-border);
    border-radius: 5px;
    font-family: inherit;
    color: inherit;
    padding: 2px 10px;
    background-color: var(--color-input-bg);
    font-size: inherit;
    color-scheme: var(--color-scheme, dark);
    transition: background-color 0.2s ease, color 0.2s ease;
}

    select:hover,
    input:is(:not([type]), .text, [type=text], [type=password], [type=search],
             [type=url], [type=tel], [type=email], [type=number], [type=color],
             [type=date], [type=datetime-local], [type=time], [type=month], [type=week]):hover {
        border-color: var(--color-input-border-hover);
        background-color: var(--color-input-bg-hover);
    }

    /* After :hover, so that hovering does not change it */
    input:is(:not([type]), .text, [type=text], [type=password], [type=search],
             [type=url], [type=tel], [type=email], [type=number],
             [type=date], [type=datetime-local], [type=time], [type=month], [type=week]):read-only {
        background-color: var(--color-input-bg-hover);
        border-color: var(--color-input-bg-disabled);
    }

    /* After :read-only, as disabled inputs match it too */
    select:is(.disabled, :disabled),
    input:is(:not([type]), .text, [type=text], [type=password], [type=search],
             [type=url], [type=tel], [type=email], [type=number], [type=color],
             [type=date], [type=datetime-local], [type=time], [type=month], [type=week]):is(.disabled, :disabled) {
        background-color: var(--color-input-bg-disabled);
        border-color: var(--color-input-border);
        color: var(--color-text-secondary);
        cursor: not-allowed;
    }

.reu-mono,
code,
pre,
kbd,
samp,
tt,
var,
textarea {
    font-family: var(--font-mono), monospace !important;
    font-variant-ligatures: no-common-ligatures;
    font-weight: 200;
}

textarea {
    padding: 5px;
    border-radius: 5px 0 0 5px;
    background: var(--color-input-bg);
    color: var(--color-text-primary);
    border: 1px solid var(--color-input-border);
    transition: background-color 0.2s ease, color 0.2s ease;
}

    textarea:read-only {
        background-color: var(--color-input-bg-hover);
        border: 1px solid var(--color-input-bg-disabled);
    }

    textarea:disabled {
        background-color: var(--color-input-bg-disabled);
        border-color: var(--color-input-border);
        color: var(--color-text-secondary);
        cursor: not-allowed;
    }

progress {
    border: 1px solid var(--color-input-border);
    border-radius: 5px;
}
    progress::-webkit-progress-bar {
        border-radius: 5px;
        background-color: var(--color-input-bg);
    }

    progress::-webkit-progress-value {
        border-radius: 5px;
        background-color: var(--color-blue);
    }

    progress::-moz-progress-bar {
        border-radius: 0px !important;
        background-color: var(--color-blue);
    }

footer.reu-footer {
    background: var(--color-surface-secondary);
    transition: background-color 0.2s ease;
}

    footer.reu-footer small {
        color: var(--color-text-secondary);
    }

.footer-discover-more {
    margin-top: 1rem;
    display: flex;
    align-items: center;
    gap: 0.5rem 1rem;
    flex-wrap: wrap;
    font-size: 75%;
}

    .footer-discover-more code {
        flex: 1;
        display: inline-flex;
        align-items: center;
        justify-content: right;
        font-size: 80%;
        color: var(--color-text-secondary);
        white-space: nowrap;
        gap: 0.2rem;
    }

    .footer-discover-more .footer-buttons {
        flex: 1;
        display: flex;
        justify-content: end;
        gap: 0.5rem;
    }

.reu-theme-icon {
    cursor: pointer;
    width: 20px;
    height: 20px;
    opacity: 0.7;
    transition: opacity 0.15s ease;
    background: url('icons/light.svg') no-repeat center / contain;
}

    .reu-theme-icon:hover {
        opacity: 1;
    }

[data-theme="light"] .reu-theme-icon {
    background-image: url('icons/light_fill.svg');
    filter: invert(0.6);
}

/* <ReuThemeToggle>, works without interactivity as it calls reuniverse.theme.js directly */
.reu-theme-toggle {
    display: inline-flex;
    /* makes it at least 24px across, which is easier to hit, while the bulb stays as it was */
    padding: 2px;
    cursor: pointer;
    border-radius: 4px;
}

    .reu-theme-toggle .reu-theme-icon {
        display: block;
    }

    .reu-theme-toggle:is(:hover, :focus-visible) .reu-theme-icon {
        opacity: 1;
    }

/* <ReuSplitPane>, resized by reuniverse.js through --reu-split-size */
.reu-split-pane {
    --reu-split-handle-size: 8px;
    display: flex;
    min-width: 0;
    min-height: 0;
}

    .reu-split-pane.vertical {
        flex-direction: column;
    }

    .reu-split-pane.bordered {
        border: 1px solid var(--color-border);
        border-radius: 4px;
    }

    .reu-split-pane > .reu-split-first {
        flex: 0 0 var(--reu-split-size, 50%);
        min-width: var(--reu-split-first-min, 0px);
        max-width: calc(100% - var(--reu-split-second-min, 0px) - var(--reu-split-handle-size));
        min-height: 0;
        overflow: auto;
    }

    .reu-split-pane > .reu-split-second {
        flex: 1 1 0;
        min-width: 0;
        min-height: 0;
        overflow: auto;
    }

    .reu-split-pane.vertical > .reu-split-first {
        min-width: 0;
        max-width: none;
        min-height: var(--reu-split-first-min, 0px);
        max-height: calc(100% - var(--reu-split-second-min, 0px) - var(--reu-split-handle-size));
    }

    /* a thin line in the middle of a wider area that is easier to grab */
    .reu-split-pane > .reu-split-handle {
        flex: 0 0 var(--reu-split-handle-size);
        position: relative;
        cursor: col-resize;
        touch-action: none;
    }

    .reu-split-pane.vertical > .reu-split-handle {
        cursor: row-resize;
    }

        .reu-split-pane > .reu-split-handle::after {
            content: "";
            position: absolute;
            inset: 0 calc(50% - 1px);
            background-color: var(--color-border);
            transition: background-color 0.1s ease, inset 0.1s ease;
        }

        .reu-split-pane.vertical > .reu-split-handle::after {
            inset: calc(50% - 1px) 0;
        }

        .reu-split-pane > .reu-split-handle:is(:hover, :focus-visible, .dragging)::after {
            inset: 0 calc(50% - 2px);
            background-color: var(--color-link);
        }

        .reu-split-pane.vertical > .reu-split-handle:is(:hover, :focus-visible, .dragging)::after {
            inset: calc(50% - 2px) 0;
        }

        .reu-split-pane > .reu-split-handle:focus-visible {
            outline: none;
        }

    /* keeps the text from being selected and iframes from taking the pointer while dragging */
    .reu-split-pane.resizing {
        user-select: none;
    }

        .reu-split-pane.resizing iframe {
            pointer-events: none;
        }

.invalid {
    outline: 1px solid var(--color-red);
}

.validation-message {
    font-size: 80%;
    padding: 0.5rem 0;
    color: var(--color-red);
}

.valid {
    color: var(--color-green);
}

/* A single-color SVG that takes the color of the text, so it follows the theme.
   The element sets mask-image itself, as a url() in a variable would resolve against this file. */
.reu-mask-icon {
    display: inline-block;
    background-color: var(--reu-icon-color, currentColor);
    mask-position: center;
    mask-repeat: no-repeat;
    mask-size: contain;
}

/* Tooltip, created by reuniverse.js for data-reu-tooltip */
.reu-tooltip {
    position: fixed;
    z-index: 10002;
    box-sizing: border-box;
    /* As wide as the text up to the maximum, wherever it is. Left to itself, a fixed element only
       gets the room between where it is and the edge, and wraps far too early near the edge. */
    width: max-content;
    /* the percentage is of the window without its scrollbar, less the gap kept to each edge by reuniverse.js */
    max-width: min(20rem, calc(100% - 16px));
    /* but as wide as the longest word, such as a file name, which takes precedence over the maximum */
    min-width: min-content;
    /* 1px lower, as Rubik sits high in its line box. A whole pixel, as text snaps to them */
    padding: calc(0.25rem + 1px) 0.5rem calc(0.25rem - 1px);
    border: 1px solid var(--color-tooltip-border);
    border-radius: 0.25rem;
    background: var(--color-tooltip-bg);
    box-shadow: 0 2px 8px #0005;
    backdrop-filter: blur(10px);
    color: var(--color-tooltip-text);
    font-size: 80%;
    line-height: 1.3;
    /* breaks inside a word only when it does not fit on a line of its own, unlike anywhere,
       which also lets the width shrink to the longest letter rather than the longest word */
    overflow-wrap: break-word;
    white-space: pre-line;
    pointer-events: none;
    animation: reu-fade-in 0.1s ease-out;
}

/* each word, put in its own span by reuniverse.js */
.reu-tooltip > span {
    white-space: nowrap;
}

/* set by reuniverse.js when a word is wider than the window, so that it breaks to fit after all */
.reu-tooltip.reu-tooltip-overflowing {
    min-width: 0;
}

.reu-tooltip.reu-tooltip-overflowing > span {
    white-space: inherit;
}

/* Error panel, created by reuniverse.js in place of #blazor-error-ui.
   Docked rather than modal, as what is on the page may still be worth saving.
   Above the upload screen, as it covers the whole page, and below the reconnect modal. */
.reu-error-panel {
    position: fixed;
    inset: auto 0 1rem;
    z-index: 10000;
    box-sizing: border-box;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    width: min(46rem, calc(100vw - 2rem));
    max-height: calc(100dvh - 2rem);
    margin-inline: auto;
    padding: 1rem 1.25rem;
    border: 1px solid var(--color-border);
    border-top: 3px solid var(--color-red);
    border-radius: 8px;
    background: var(--color-modal-surface);
    box-shadow: var(--shadow-modal);
    color: var(--color-text-primary);
    font-size: 90%;
    overflow-y: auto;
    animation: reu-modal-panel-in 0.18s ease;
}

    .reu-error-panel [hidden] {
        display: none;
    }

    .reu-error-panel button:focus-visible,
    .reu-error-panel summary:focus-visible,
    .reu-error-log:focus-visible {
        outline: 2px solid var(--color-link);
        outline-offset: 2px;
    }

.reu-error-header {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.reu-error-icon {
    color: var(--color-red);
    font-size: 1.2rem;
    line-height: 1;
}

.reu-error-title {
    flex: 1;
    font-size: 1.05rem;
    font-weight: 600;
}

.reu-error-dismiss {
    cursor: pointer;
    color: var(--color-text-secondary);
    line-height: 1;
    padding: 0.4rem 0.5rem;
    border-radius: 4px;
    transition: color 0.1s ease, background-color 0.1s ease;
}

    .reu-error-dismiss:hover {
        color: var(--color-text-primary);
        background-color: var(--color-overlay-medium);
    }

.reu-error-message {
    margin: 0;
    color: var(--color-text-secondary);
}

.reu-error-details summary {
    cursor: pointer;
    color: var(--color-text-secondary);
    font-size: 90%;
}

.reu-error-log {
    position: relative;
    display: grid;
    grid-template-columns: minmax(max-content, 1fr);
    align-content: start;
    max-height: min(20rem, 40dvh);
    margin-top: 0.5rem;
    padding: 0.5rem 0.75rem;
    border: 1px solid var(--color-border);
    border-radius: 4px;
    background: var(--color-input-bg);
    font-size: 75%;
    line-height: 1.5;
    white-space: pre;
    overflow: auto;
}

.reu-error-entry + .reu-error-entry {
    margin-top: 0.5rem;
    padding-top: 0.5rem;
    border-top: 1px solid var(--color-border-subtle);
}

.reu-error-time {
    margin-right: 0.75em;
    color: var(--color-text-secondary);
}

.reu-error-actions {
    display: flex;
    justify-content: flex-end;
    gap: 0.5rem;
}

    .reu-error-actions .reu-button {
        padding: 0.4rem 1rem;
    }

/* Update prompt, created by reuniverse.js when a new version of the app is ready.
   In a corner, as it can wait, and level with the error panel above the upload screen. */
.reu-update-prompt {
    position: fixed;
    right: 1rem;
    bottom: 1rem;
    z-index: 10000;
    box-sizing: border-box;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    width: min(22rem, calc(100vw - 2rem));
    padding: 1rem 1.25rem;
    border: 1px solid var(--color-border);
    border-top: 3px solid var(--color-blue);
    border-radius: 8px;
    background: var(--color-modal-surface);
    box-shadow: var(--shadow-modal);
    color: var(--color-text-primary);
    font-size: 90%;
    animation: reu-modal-panel-in 0.18s ease;
}

    .reu-update-prompt button:focus-visible {
        outline: 2px solid var(--color-link);
        outline-offset: 2px;
    }

.reu-update-title {
    font-size: 1.05rem;
    font-weight: 600;
}

.reu-update-message {
    margin: 0;
    color: var(--color-text-secondary);
}

.reu-update-actions {
    display: flex;
    justify-content: flex-end;
    gap: 0.5rem;
    margin-top: 0.25rem;
}

    .reu-update-actions .reu-button {
        padding: 0.4rem 1rem;
    }

/* for a reconnect modal of the app's own, as ReuReconnectModal has its own styles */
#components-reconnect-modal:not(.reu-reconnect) {
    display: none;
    background-color: var(--color-modal-bg);
    text-align: center;
    position: fixed;
    top: 0;
    z-index: 10001;
    width: calc(100% - 4rem);
    height: calc(100vh - 4rem);
    align-items: center;
    justify-content: center;
    animation: reu-fade-in 0.5s;
    flex-direction: column;
    gap: 20px;
    padding: 2rem;
}

    #components-reconnect-modal:not(.reu-reconnect):is(.components-reconnect-show, .components-reconnect-failed, .components-reconnect-rejected) {
        display: flex;
    }

    #components-reconnect-modal .reu-connection-lost {
        font-size: 200%
    }

    #components-reconnect-modal .reu-connection-lost-detail {
        font-size: 75%;
        color: var(--color-text-secondary);
    }

@keyframes reu-fade-in {
    from {
        opacity: 0;
    }
}

@keyframes reu-modal-panel-in {
    from {
        opacity: 0;
        transform: scale(0.96) translateY(-6px);
    }
}

@media (prefers-reduced-motion: reduce) {
    .reu-tooltip,
    .reu-error-panel,
    .reu-update-prompt {
        animation: none;
    }
}

/* Scrollbar */
* {
    scrollbar-color: var(--color-scrollbar-thumb) var(--color-input-bg);
}

.reu-scrollbar-thin {
    scrollbar-color: var(--color-scrollbar-thumb) var(--color-input-bg);
}
