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

a, .btn-link {
    color: #006bb7;
}

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

.construction-banner {
    background: #fff3cd;
    color: #664d03;
    border-bottom: 1px solid #ffe69c;
    padding: 10px 1rem;
    text-align: center;
    font-weight: 600;
}

.content {
    padding-top: 1.1rem;
}

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+PHBhdGggZD0iTTI2My41MDYgNTFDMjY0LjcxNyA1MSAyNjUuODEzIDUxLjQ4MzcgMjY2LjYwNiA1Mi4yNjU4TDI2Ny4wNTIgNTIuNzk4NyAyNjcuNTM5IDUzLjYyODMgMjkwLjE4NSA5Mi4xODMxIDI5MC41NDUgOTIuNzk1IDI5MC42NTYgOTIuOTk2QzI5MC44NzcgOTMuNTEzIDI5MSA5NC4wODE1IDI5MSA5NC42NzgyIDI5MSA5Ny4wN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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;
}


/* BracketTree styles moved to app.css so media queries work and styling is centralized */
/* Layout is computed and applied by bracketTree.js: every .node gets an explicit
   position:absolute left/top so a node's screen position always matches the
   real parent/child relationship (mean-of-children), instead of relying on
   flexbox to independently center each round and hoping it lines up. */
.bracket-container {
    position: relative;
    padding: 14px;
    box-sizing: border-box;
    overflow: auto;
    max-width: 100%;
}

/* .level / .level-inner are structural grouping only -- display:contents removes
   their own box so .node children lay out (and position:absolute against)
   .bracket-container directly, without needing to change the Razor markup. */
.level,
.level-inner {
    display: contents;
}

/* node visuals */
.node {
    box-sizing: border-box;
    padding: 8px 12px;
    min-width: 120px;
    text-align: center;
    background: white;
    border: 1px solid #d2d9e6;
    border-radius: 6px;
    z-index: 2;
    font-size: 0.95rem;
    box-shadow: 0 1px 0 rgba(0,0,0,0.02);
    white-space: nowrap;
}

.node-label {
    pointer-events: auto;
    cursor: pointer;
}

.node-label-winner {
    font-weight: bold;
}

/* Synthetic elements bracketTree.js creates when a branch is too wide to fit
   and gets split into its own panel below: a small colored/labeled marker
   where the branch was cut, and a matching tag above the panel that continues
   it, so the two visually pair up without drawing a connector between them. */
.bracket-chip {
    position: absolute;
    z-index: 3;
    border-radius: 50%;
    color: white;
    font-size: 0.7rem;
    font-weight: bold;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 1px 2px rgba(0,0,0,0.25);
    cursor: default;
}

.panel-label {
    position: absolute;
    z-index: 3;
    padding: 2px 10px;
    border-left: 4px solid;
    background: rgba(0,0,0,0.04);
    border-radius: 3px;
    font-size: 0.8rem;
    font-weight: bold;
    white-space: nowrap;
}

/* svg overlay */
.bracket-svg {
    z-index: 1;
    position: absolute;
    left: 0;
    top: 0;
}

/* connector classes - colors are driven by CSS variables set on container element */
.connector {
    stroke: var(--connector-default, #c7cfe0);
    stroke-width: var(--connector-width, 3px);
    fill: none;
    stroke-linecap: round;
    stroke-linejoin: round;
    vector-effect: non-scaling-stroke;
}

.connector-winning {
    stroke: var(--connector-winning, #28a745);
}

.connector-loss {
    stroke: var(--connector-loss, #a7a328);
}

.connector-default {
    stroke: var(--connector-default, #c7cfe0);
}

/* On narrow screens the tree keeps its real geometry (wrapping a tree diagram
   breaks the parent/child lines) and scrolls horizontally instead; just shrink
   nodes a bit so more of the bracket is visible per screen. */
@media (max-width: 900px) {
    .node {
        min-width: 96px;
        padding: 6px 8px;
        font-size: 0.85rem;
    }
}

/* Self-hosted Material Symbols variable font, backing AppIcon
   (Components/Shared/AppIcon.razor). Ported from the ReadyPublisher sibling
   project's same pattern. Apache-2.0 licensed, freely self-hostable. Ligature
   text (e.g. "edit") renders as the glyph. font-display:block hides the raw
   ligature text briefly instead of flashing it. */
@font-face {
    font-family: "Material Symbols";
    src: url("fonts/MaterialSymbolsOutlined.woff2") format("woff2 supports variations"),
         url("fonts/MaterialSymbolsOutlined.woff2") format("woff2-variations");
    font-style: normal;
    font-weight: 100 700;
    font-display: block;
}

.app-icon {
    font-family: "Material Symbols";
    display: inline-flex;
    justify-content: center;
    align-items: center;
    font-size: 1.25rem;
    width: 1.25rem;
    height: 1.25rem;
    line-height: 1;
    vertical-align: middle;
    user-select: none;
    font-weight: normal;
    font-style: normal;
    /* Outlined, not filled. */
    font-variation-settings: "FILL" 0;
}

/* These classes are already used throughout the app's markup but had no
   matching CSS until now -- buttons rendered with plain browser defaults. */
.favorite.styled,
button.favorite.styled,
input.favorite.styled[type="button"] {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.4rem;
    padding: 4px 10px;
    height: 30px;
    line-height: 1;
    font: inherit;
    border: 1px solid #bdbdbd;
    background: #eee;
    color: #212529;
    border-radius: 3px;
    cursor: pointer;
    /* Without this, iOS Safari renders its own default button chrome (a
       washed-out label color) on top of the above regardless of the
       explicit color set here -- the button looks greyed-out/disabled
       even though it's a normal enabled button. */
    -webkit-appearance: none;
    appearance: none;
}

    /* Size the icon to match text height and center it. */
    .favorite.styled .app-icon {
        font-size: 16px;
        height: 1em;
        width: 1em;
        line-height: 1;
        display: inline-block;
        vertical-align: middle;
    }

    .favorite.styled.btn-warning,
    button.favorite.styled.btn-warning,
    input.favorite.styled.btn-warning[type="button"] {
        background: #ffc107;
        border-color: #d39e00;
        color: #212529;
    }

        .favorite.styled.btn-warning .app-icon {
            color: inherit;
        }

        button.favorite.styled.btn-warning:active,
        button.favorite.styled.btn-warning:focus,
        button.favorite.styled.btn-warning:focus-visible {
            background: #e0a800;
            border-color: #c69500;
            color: #212529;
            outline: none;
            box-shadow: 0 0 0 3px rgba(217,160,0,0.12);
        }

    .favorite.styled.btn-danger,
    button.favorite.styled.btn-danger,
    input.favorite.styled.btn-danger[type="button"] {
        background: #991305;
        border-color: #4a0401;
        color: #ebe6e6;
    }

        .favorite.styled.btn-danger .app-icon {
            color: inherit;
        }

        button.favorite.styled.btn-danger:active,
        button.favorite.styled.btn-danger:focus,
        button.favorite.styled.btn-danger:focus-visible {
            background: #781005;
            border-color: #210200;
            color: #ebe6e6;
            outline: none;
            box-shadow: 0 0 0 3px rgba(217,160,0,0.12);
}