.cursor-pointer {
    cursor: pointer;
}

a.disabled {
    pointer-events: none;
}

.collapsable {
    display: grid;
    grid-template-rows: 0fr;
    transition: 0.2s grid-template-rows ease;
}

.collapsable.show {
    grid-template-rows: 1fr;
}

.collapsable > div {
    overflow: hidden;
}

.qm-toast {
    position: relative;
    overflow: hidden;
}

.qm-toast-progress {
    position: absolute;
    bottom: 0;
    left: 0;
    height: 3px;
    width: 100%;
    opacity: 0.6;
    transform-origin: left center;
    animation-name: qm-toast-progress;
    animation-timing-function: linear;
    animation-fill-mode: forwards;
    animation-play-state: running;
}

.qm-toast:hover .qm-toast-progress {
    animation-play-state: paused;
}

@keyframes qm-toast-progress {
    from {
        transform: scaleX(1);
    }
    to {
        transform: scaleX(0);
    }
}

/* Blazor autogenerated, don't place anything underneath this line! */
.valid.modified:not([type=checkbox]) {
    outline: 1px solid #26b050;
}

.invalid {
    outline: 1px solid red;
}

.validation-message {
    color: red;
}

#blazor-error-ui {
    background: lightyellow;
    bottom: 0;
    box-shadow: 0 -1px 2px rgba(0, 0, 0, 0.2);
    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+PC9kZWZzPjxnIGNsaXAtcGF0aD0idXJsKCNjbGlwMCkiIHRyYW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I4MzcgMjYxLjA0OSA5My41Mjk1IDI2My41NzYgOTMuNTI5NSAyNjYuMTE2IDkzLjUyOTUgMjY3LjM4NyA5Mi4yODM3IDI2Ny4zODcgODkuNzkyMSAyNjcuMzg3IDg3LjMwMDUgMjY2LjExNiA4Ni4wNTQ3IDI2My41NzYgODYuMDU0N1oiIGZpbGw9IiNGRkU1MDAiIGZpbGwtcnVsZT0iZXZlbm9kZCIvPjwvZz48L3N2Zz4=) 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: relative;
    display: block;
    width: 8rem;
    height: 8rem;
    margin: 20vh auto 1rem 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;
}

/* CodeMirror 5 host: sized to match the old textarea (10 rows ~240px). */
.cm-host .CodeMirror {
    height: 240px;
    font-size: 14px;
}

/* Presence pills above the collaborative editor */
.presence-pill {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 1.5rem;
    height: 1.5rem;
    border-radius: 50%;
    color: white;
    font-size: 0.7rem;
    font-weight: 600;
    line-height: 1;
    box-shadow: 0 0 0 2px var(--bs-body-bg);
}

/* Remote cursor labels from y-codemirror: show the name on hover rather
   than permanently hiding it. The library adds `hide-name` when idle. */
.cm-host .remote-caret > div {
    opacity: 0;
    transition: opacity 0.15s;
}
.cm-host .remote-caret:hover > div,
.cm-host .remote-caret:not(.hide-name) > div {
    opacity: 1;
}

/* Fluid overlay token colours for the PDF template editor (fluid-xml mode). */
.cm-fluid-output {
    color: #1565c0;
    font-weight: 600;
}
.cm-fluid-tag {
    color: #ad1457;
    font-weight: 600;
}
[data-bs-theme="dark"] .cm-fluid-output {
    color: #64b5f6;
}
[data-bs-theme="dark"] .cm-fluid-tag {
    color: #f48fb1;
}

/* PDF template editor: full-width split layout (wide code editor + narrow live preview).
   When this page is active, turn the layout chain into a viewport-height flex column so
   the workspace fills the area below the navbar exactly - no JS, no scrollbars. Scoped via
   :has() so every other page is untouched. */
#app:has(.pdf-tpl-workspace) {
    display: flex;
    flex-direction: column;
    height: 100dvh;
    overflow: hidden;
}
#app:has(.pdf-tpl-workspace) > .container {
    flex: 1 1 auto;
    min-height: 0;
    display: flex;
    flex-direction: column;
    max-width: none;
    width: 100%;
    margin-bottom: 0;
}
.pdf-tpl-workspace {
    flex: 1 1 auto;
    min-height: 0;
    display: flex;
    flex-direction: column;
}
.pdf-tpl-split {
    flex: 1 1 auto;
    min-height: 0;
    display: flex;
    gap: 1rem;
}
.pdf-tpl-code {
    flex: 2 1 0;
    min-width: 0;
    display: flex;
    flex-direction: column;
}
.pdf-tpl-preview {
    flex: 1 1 0;
    min-width: 0;
    display: flex;
    flex-direction: column;
}
.pdf-tpl-cm {
    flex: 1 1 auto;
    min-height: 0;
    border: 1px solid var(--bs-border-color);
    border-radius: .375rem;
    overflow: hidden;
}
.pdf-tpl-cm > .CodeMirror {
    height: 100%;
}
.pdf-tpl-tabbody {
    flex: 1 1 auto;
    min-height: 0;
    display: flex;
    flex-direction: column;
}
.pdf-tpl-preview-frame {
    flex: 1 1 auto;
    min-height: 0;
    width: 100%;
    border: 1px solid var(--bs-border-color);
    border-radius: .375rem;
}
/* Bootstrap loads after app.css, so the selectors are qualified with .form-check to win over its .form-check defaults. */
.form-check.accreditation-check-row {
    display: flex;
    align-items: center;
    gap: .5rem;
    min-height: calc(1.5em + .75rem + calc(var(--bs-border-width) * 2));
    padding-left: 0;
    margin-bottom: 0;
}
.form-check.accreditation-check-row .form-check-input {
    float: none;
    margin: 0;
}
.rendered-markdown table {
    margin-bottom: 1rem;
    border-collapse: collapse;
}
.rendered-markdown th,
.rendered-markdown td {
    padding: .25rem .75rem;
    border: var(--bs-border-width) solid var(--bs-border-color);
}
.rendered-markdown > :last-child {
    margin-bottom: 0;
}

.diff-line {
    white-space: pre-wrap;
}

/* Assembly assistant console. app.css loads before Bootstrap, so rules that override Bootstrap need a second class. */
.assembly-label {
    font-size: 0.75rem;
    font-weight: 600;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: var(--bs-secondary-color);
    margin-bottom: 0.25rem;
}

.assembly-status {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    font-size: 0.875rem;
    padding: 0.25rem 0.6rem;
    border: 1px solid var(--bs-border-color);
    border-radius: var(--bs-border-radius);
    line-height: 1.5;
}

.assembly-dot {
    display: inline-block;
    width: 0.6rem;
    height: 0.6rem;
    border-radius: 50%;
    flex-shrink: 0;
}

.assembly-controls > .col + .col {
    border-left: 1px solid var(--bs-border-color);
}

.assembly-card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
    padding: 0.5rem 0.75rem;
    font-weight: 600;
}

.list-group-flush > .list-group-item.assembly-queue-entry {
    border-left: 3px solid transparent;
    padding: 0.5rem 0.75rem;
}

.list-group-flush > .list-group-item.assembly-queue-entry.assembly-suggested {
    border-left-color: var(--bs-primary);
    background-color: var(--bs-primary-bg-subtle);
}

.list-group-item.assembly-queue-entry.assembly-dismissed {
    opacity: 0.55;
}

.assembly-flag {
    display: inline-block;
    font-size: 0.7rem;
    font-weight: 600;
    line-height: 1.4;
    padding: 0.05rem 0.45rem;
    border-radius: 999px;
    border: 1px solid transparent;
}

.btn.assembly-icon-btn {
    width: 2rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.assembly-timer {
    font-family: var(--bs-font-monospace);
    font-size: 2.25rem;
    font-weight: 600;
    line-height: 1;
    font-variant-numeric: tabular-nums;
}

.assembly-floor-item + .assembly-floor-item {
    border-top: 1px solid var(--bs-border-color);
}

.input-group.assembly-time-input {
    width: 7.5rem;
}

.assembly-scroll {
    max-height: 20rem;
    overflow-y: auto;
}

.assembly-shrink {
    min-width: 0;
}

/* Fixed layout so the server and browser tables on the attributions page line up. */
.attribution-table {
    table-layout: fixed;
}

.attribution-project {
    width: 70%;
}
