/* Layout */

body {
    font-family: 'Segoe UI', system-ui, sans-serif;
}

#layout-wrapper {
    height: calc(100vh - 57px);
}

/* Sidebar */

@media (min-width: 992px) {
    #sidebar {
        width: 260px !important;
        border-right: 1px solid var(--bs-border-color);
        position: relative;
        transform: none !important;
        visibility: visible !important;
    }
}

/* Info section chevron */

.info-chevron {
    transition: transform 0.2s ease;
}

.info-chevron.rotated {
    transform: rotate(180deg);
}

/* Info section code blocks */

.info-code {
    font-family: 'Consolas', 'Fira Code', monospace;
    font-size: 0.78rem;
    background: var(--bs-tertiary-bg);
    margin-bottom: 0.75rem;
    white-space: pre;
    overflow-x: auto;
}

/*  CodeMirror editor */

#editor-wrapper .CodeMirror {
    height: 300px;
    font-family: 'Consolas', 'Fira Code', 'JetBrains Mono', monospace;
    font-size: 14px;
    border-radius: 0.375rem;
}

#editor-wrapper {
    overflow: hidden;
}

/* Output panel  */

#output {
    font-family: 'Consolas', 'Fira Code', monospace;
    font-size: 14px;
    min-height: 80px;
    background: #1e1e1e;
    color: #d4d4d4;
    border: none !important;
    /* white-space is left to child elements: <pre> for text, SVG for histograms */
}

[data-bs-theme="light"] #output {
    background: #f8f9fa;
    color: #212529;
    border: 1px solid #dee2e6 !important;
}

#output.error {
    color: #f48771;
}

[data-bs-theme="light"] #output.error {
    color: #c0392b;
}

/* Sidebar program list */

.program-item {
    cursor: pointer;
    transition: background-color 0.15s ease;
    border-radius: 0.375rem;
    padding: 0.4rem 0.6rem;
    font-size: 0.875rem;
    border: 1px solid transparent;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    text-align: left;
    width: 100%;
    background: none;
    color: var(--bs-body-color);
}

.program-item:hover {
    background: var(--bs-tertiary-bg);
    border-color: var(--bs-border-color);
}

.program-category {
    font-size: 0.7rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--bs-secondary-color);
    padding: 0.5rem 0.25rem 0.2rem;
    margin-top: 0.5rem;
}

.program-category:first-child {
    margin-top: 0;
}

/* Output panel — HTML mode (histograms + text) */

/* Plain text blocks inside HTML output */
#output pre.yappl-text {
    font-family: 'Consolas', 'Fira Code', monospace;
    font-size: 14px;
    margin: 0;
    white-space: pre-wrap;
    background: transparent;
    border: none;
    padding: 0;
    color: inherit;
}

/* Inline SVG histograms */
#output svg {
    overflow: visible;
}

/* Ensure SVG text inherits the panel colour so it adapts to light/dark */
#output svg text {
    font-family: 'Consolas', 'Fira Code', monospace;
}
