h1:focus {
    outline: none;
}

.document-viewer {
    width: 100%;
    height: 80vh;
}

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

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

/* The admin's own accent, from the sidebar's manila end. */
:root {
    --dc-accent: #b07418;
    --dc-accent-soft: rgba(176, 116, 24, 0.12);
    --dc-accent-ring: rgba(176, 116, 24, 0.35);
}

.form-control:focus,
.form-select:focus,
.form-check-input:focus {
    border-color: var(--dc-accent);
    box-shadow: 0 0 0 0.25rem var(--dc-accent-ring);
}

.form-check-input:checked {
    background-color: var(--dc-accent);
    border-color: var(--dc-accent);
}

.form-label {
    font-weight: 600;
}

.page-heading {
    margin-bottom: 1.5rem;
}

    .page-heading h1 {
        margin-bottom: 0.25rem;
    }

    .page-heading p {
        color: var(--bs-secondary-color);
        max-width: 44rem;
    }

.form-card {
    border: 0;
    border-radius: 1rem;
    box-shadow: 0 0.5rem 1.5rem rgba(36, 23, 12, 0.08), 0 0.125rem 0.25rem rgba(36, 23, 12, 0.06);
}

.form-step {
    display: flex;
    gap: 1rem;
    margin-bottom: 1.75rem;
}

/* A flex child will not shrink below its content unless told to, so a long file name would push the card wider. */
.form-step > .flex-grow-1 {
    min-width: 0;
}

.form-step-number {
    flex: 0 0 auto;
    width: 2rem;
    height: 2rem;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    color: #fff;
    background-image: linear-gradient(180deg, #5e3a14 0%, #9a6618 100%);
}

/* Searchable dropdown */
.searchable-select {
    position: relative;
}

.searchable-select-toggle {
    min-height: calc(1.5em + 0.75rem + 2px);
}

.searchable-select.is-open .searchable-select-toggle {
    border-color: var(--dc-accent);
    box-shadow: 0 0 0 0.25rem var(--dc-accent-ring);
}

.searchable-select-backdrop {
    position: fixed;
    inset: 0;
    z-index: 1040;
}

.searchable-select-menu {
    position: absolute;
    z-index: 1050;
    top: calc(100% + 0.25rem);
    left: 0;
    right: 0;
    min-width: 16rem;
    background: var(--bs-body-bg);
    border: 1px solid var(--bs-border-color);
    border-radius: 0.75rem;
    overflow: hidden;
}

.searchable-select-options {
    max-height: 18rem;
    overflow-y: auto;
    padding: 0.25rem 0;
}

.searchable-select-heading {
    padding: 0.5rem 1rem 0.25rem;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--bs-secondary-color);
}

.searchable-select-option {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    width: 100%;
    padding: 0.5rem 1rem;
    border: 0;
    background: transparent;
    color: inherit;
}

    .searchable-select-option.is-highlighted {
        background: var(--dc-accent-soft);
    }

    .searchable-select-option.is-selected {
        font-weight: 600;
    }

/* Initials badge */
.initials {
    flex: 0 0 auto;
    width: 2rem;
    height: 2rem;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 0.75rem;
    font-weight: 700;
    color: #fff;
    background: hsl(var(--initials-hue), 45%, 42%);
}

.initials-sm {
    width: 1.5rem;
    height: 1.5rem;
    font-size: 0.625rem;
}

/* File drop zone */
.file-drop {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.25rem;
    min-height: 11rem;
    padding: 1.5rem;
    text-align: center;
    border: 2px dashed var(--bs-border-color);
    border-radius: 1rem;
    background: var(--bs-tertiary-bg);
    transition: border-color 0.15s ease, background-color 0.15s ease;
}

    .file-drop:hover,
    .file-drop.is-dragging {
        border-color: var(--dc-accent);
        background: var(--dc-accent-soft);
    }

    .file-drop.has-file {
        min-height: 0;
        border-style: solid;
        background: var(--bs-body-bg);
    }

.file-drop-input {
    position: absolute;
    inset: 0;
    opacity: 0;
    cursor: pointer;
}

.file-drop-icon {
    width: 2.75rem;
    height: 2.75rem;
    fill: var(--dc-accent);
    margin-bottom: 0.25rem;
}

.file-drop-chosen {
    display: flex;
    align-items: center;
    gap: 1rem;
    width: 100%;
}

    .file-drop-chosen .file-drop-icon {
        margin: 0;
    }

    .file-drop-chosen .flex-grow-1 {
        min-width: 0;
        overflow-wrap: anywhere;
    }

    .file-drop-chosen .file-drop-icon,
    .file-drop-chosen .btn {
        flex: 0 0 auto;
    }

/* Upload result */
.result-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 4rem;
    height: 4rem;
    border-radius: 50%;
    font-size: 1.75rem;
    font-weight: 700;
    color: #fff;
}

    .result-badge.is-settled {
        background: var(--bs-success);
    }

    .result-badge.is-review {
        background: var(--dc-accent);
    }

/* Decisions on a document, as a timeline */
.timeline {
    list-style: none;
    padding-left: 0;
    border-left: 2px solid var(--bs-border-color);
    margin-left: 0.5rem;
}

.timeline-item {
    position: relative;
    padding: 0 0 1rem 1.25rem;
}

    .timeline-item::before {
        content: "";
        position: absolute;
        left: -0.45rem;
        top: 0.35rem;
        width: 0.8rem;
        height: 0.8rem;
        border-radius: 50%;
        background: var(--bs-secondary-bg);
        border: 2px solid var(--bs-border-color);
    }

    .timeline-item.is-decided::before {
        background: var(--bs-success);
        border-color: var(--bs-success);
    }

    .timeline-item.is-open::before {
        background: var(--dc-accent);
        border-color: var(--dc-accent);
    }

/* Rule test: what a rule reads, with its match marked in the accent. */
.rule-test {
    border-left: 3px solid var(--dc-accent);
    padding-left: 0.75rem;
}

.rule-test-text {
    max-height: 16rem;
    overflow: auto;
    white-space: pre-wrap;
    word-break: break-word;
    font-size: 0.8125rem;
    background: var(--bs-tertiary-bg);
    border-radius: var(--bs-border-radius);
    padding: 0.5rem 0.75rem;
    margin-bottom: 0;
}

.rule-test-text mark {
    background: var(--dc-accent-soft);
    box-shadow: inset 0 -2px 0 var(--dc-accent);
    padding: 0 0.1em;

/* Rule coverage: the type column stays put while wealth managers scroll; a type given by hand with no rule is marked in the accent. */
.coverage .coverage-type {
    position: sticky;
    left: 0;
    background: var(--bs-body-bg);
    min-width: 12rem;
}

.coverage td {
    min-width: 9rem;
}

.coverage td.coverage-gap {
    background: var(--dc-accent-soft);
    box-shadow: inset 3px 0 0 var(--dc-accent);
}

.coverage .coverage-gap-label {
    color: var(--dc-accent);
}
