.site-footer {

    padding-bottom: 2.5em;

}

.debug-console {
    position: fixed;
    left: 1rem;
    bottom: 1rem;
    z-index: 9999999997;

    width: min(720px, calc(100vw - 2rem));
    max-height: 50vh;

    display: flex;
    flex-direction: column;

    opacity: 0.95;

    background: var(--site-surface);
    color: var(--site-text);

    border: 1px solid var(--site-border);
    border-radius: 0.75rem;

    box-shadow: 0 1rem 3rem color-mix(
        in srgb,
        var(--aw-black) 35%,
        transparent
    );

    overflow: hidden;

    backdrop-filter: blur(10px);
}

.debug-console-header {
    display: flex;
    justify-content: space-between;
    gap: 0.5rem;

    padding: 0.75rem;

    background: var(--site-bg);

    border-bottom: 1px solid var(--site-border);
}

.debug-console-header button {
    border: 1px solid var(--site-border);
    border-radius: 0.5rem;

    padding: 0.45rem 0.7rem;

    background: var(--site-surface);
    color: var(--site-text);

    font-size: 0.85rem;

    transition: all 0.15s ease;
}

.debug-console-header button:hover {
    background: var(--site-bg);
}

#debug-console-count {
    display: inline-flex;
    align-items: center;
    justify-content: center;

    min-width: 1.25rem;
    min-height: 1.25rem;

    margin-left: 0.35rem;
    padding: 0 0.35rem;

    border-radius: 999px;

    background: var(--aw-warning);
    color: var(--aw-black);

    font-size: 0.75rem;
    font-weight: 700;
}

.debug-console-output {
    flex: 1 1 auto;

    min-height: 180px;
    max-height: calc(50vh - 3.5rem);

    padding: 0.75rem;

    overflow: auto;

    font-family:
        ui-monospace,
        SFMono-Regular,
        Menlo,
        Monaco,
        Consolas,
        monospace;

    font-size: 0.78rem;
}

.debug-console-entry {
    padding: 0.5rem 0;

    border-bottom: 1px solid var(--site-border);
}

.debug-console-entry:last-child {
    border-bottom: 0;
}

.debug-console-meta {
    margin-bottom: 0.25rem;

    font-size: 0.7rem;
    font-weight: 700;

    color: var(--site-muted);
}

.debug-console-message {
    margin: 0;

    white-space: pre-wrap;
    word-break: break-word;

    color: inherit;
}

/* Log levels */

.debug-console-entry-log {
    color: var(--site-text);
}

.debug-console-entry-info {
    color: var(--site-info-contrast);
}

.debug-console-entry-debug {
    color: var(--bs-secondary-text-emphasis);
}

.debug-console-entry-warn {
    color: var(--site-warning-text);
}

.debug-console-entry-error {
    color: var(--site-danger-text);
}

/* Collapsed */

.debug-console-collapsed {
    width: auto;
}

.debug-console-collapsed .debug-console-output {
    display: none;
}

/* Scrollbar */

.debug-console-output::-webkit-scrollbar {
    width: 10px;
}

.debug-console-output::-webkit-scrollbar-track {
    background: var(--site-bg);
}

.debug-console-output::-webkit-scrollbar-thumb {
    background: var(--site-border);
    border-radius: 999px;
}

.debug-console-output::-webkit-scrollbar-thumb:hover {
    background: var(--site-muted);
}

/* Mobile */

@media (max-width: 700px) {

    .debug-console {
        position: static;
        grid-column: 1 / -1;

        width: 100%;
        max-height: 55vh;

        opacity: 1;
        background: transparent;
        border: 0;
        border-radius: 0;
        box-shadow: none;
        backdrop-filter: none;
    }

    .debug-console-header {
        padding: 0.25rem 0;
        background: transparent;
    }

    .debug-console-header button {
        padding: 0.45rem 0.7rem;
        background: transparent;
        border: 0;
    }

    .debug-console-header button:hover,
    .debug-console-header button:focus-visible {
        color: var(--site-link);
        background: color-mix(in srgb, var(--site-link) 10%, transparent);
    }

    .debug-console-output {
        min-height: 220px;
        max-height: calc(55vh - 3.5rem);
    }

}
