.term-stdin-user {
    color: #2a7a2a;
    font-weight: normal;
    margin-left: 0.25em;
    font-family: inherit;
}

:root {
    --bg: #f6f7fb;
    --panel: #fff;
    --accent: #0b5cff;
    --border: #e6e6e9;
    --editor-bg: #fff;
    --text: #111;
    --text-disabled: #666;
    --text-error: #b00020;
}

body {
    font-family: system-ui, Segoe UI, Roboto, "Helvetica Neue", Arial;
    margin: 0;
    background: var(--bg);
    color: #111
}

header {
    background: #fff;
    border-bottom: 1px solid #e6e6e9;
    padding: 12px 18px;
    display: flex;
    justify-content: space-between;

    /* Config info is only clickable when authoring is enabled to avoid 
       cursor on hover which is confusing to users. */
    .config-info {
        cursor: default;
    }

    .config-info.authoring-enabled {
        cursor: pointer;
    }


    /* Layout for the config area: make .config-info a horizontal flex
       container. The inner .config-stack is a vertical column that can grow
       to occupy available space; the .student-id-container aligns to the
       right edge of that stack using align-self. */
    .config-info {
        position: relative;
        display: flex;
        align-items: center;
        gap: 8px;
    }

    .student-id-container {
        /* Keep the student-id container in normal flow. Align it to the right
           edge of the stack using align-self so it visually right-aligns
           within the header column. */
        position: static;
        display: inline-block;
        margin-left: 0;
        vertical-align: middle;
        align-self: flex-end;
    }

    /* Stack the config title and student ID vertically in a small column. The
       stack is allowed to grow (flex:1) so the reset button can sit to the
       right of the stack. */
    .config-stack {
        display: flex;
        flex-direction: column;
        align-items: stretch;
        gap: 6px;
        flex: 1 1 auto;
    }

    /* Ensure the reset button is aligned to the right edge of the header area */
    #reset-config-btn {
        align-self: center;
    }

    /* Make the config title clearly clickable when authoring mode is enabled */
    .config-title-line[role="button"] {
        cursor: default;
        transition: color 120ms ease, text-decoration 120ms ease;
    }

    .config-title-line {
        display: inline-block;
        vertical-align: middle;
        max-width: 100%;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
    }

    .config-title-line.authoring-enabled[role="button"] {
        cursor: pointer;
        color: var(--accent);
        text-decoration: underline dashed rgba(11, 92, 255, 0.18);
    }

    .author-tab .CodeMirror {
        width: 100%;
        background: var(--editor-bg);
        color: var(--text);
        border: 1px solid var(--border);
        border-radius: 6px;
    }



    /* Feedback modal styles (small, reused modal pattern) */
    .modal {
        display: none;
        position: fixed;
        inset: 0;
        background: rgba(0, 0, 0, 0.4);
        align-items: center;
        justify-content: center;
        z-index: 60;
    }

    .modal[aria-hidden="false"] {
        display: flex;
    }

    .modal-content {
        background: var(--panel);
        padding: 12px;
        border-radius: 6px;
        max-width: 720px;
        width: 90%;
        max-height: 80vh;
        display: flex;
        flex-direction: column;
        overflow: hidden;
        /* Changed from auto to hidden */
    }

    .modal-header {
        display: flex;
        align-items: center;
        justify-content: space-between;
        position: sticky;
        top: 0;
        background: var(--panel);
        z-index: 2;
        padding-bottom: 8px;
        margin-bottom: 8px;
        border-bottom: 1px solid #eee;
        flex-shrink: 0;
        /* Prevent header from shrinking */
    }

    .modal-header-actions {
        display: flex;
        gap: 8px;
    }

    .drag-over {
        outline: 2px dashed rgba(11, 92, 255, 0.3);
    }

    .dragging {
        opacity: 0.6
    }
}

.main-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
    padding: 18px
}

/* Keep legacy selector working for simple pages */
main,
.main-grid {
    display: block
}

/* Responsive main layout: stack on small screens, side-by-side on wider screens */
main {
    padding: 18px;
    display: grid;
    grid-template-columns: 1fr;
    gap: 12px;
    align-items: start;
}

/* On wider viewports place editor and side panel side-by-side
   Editor takes flexible space, side panel gets a fixed comfortable width */
@media (min-width: 880px) {
    main {
        grid-template-columns: 1fr 1fr;
    }

    /* place instructions/terminal (side) on the LEFT and editor on the RIGHT */
    #side {
        grid-column: 1;
        grid-row: 1
    }

    #editor {
        grid-column: 2;
        grid-row: 1
    }
}

/* On small viewports keep editor above side panel */
@media (max-width: 879px) {

    /* stack with side (instructions) first, then editor */
    #side {
        grid-column: 1;
        grid-row: 1
    }

    #editor {
        grid-column: 1;
        grid-row: 2
    }
}

/* On very narrow viewports stack the config area so the reset button
   doesn't disappear — place the reset button under the title/input stack
   and make the student-id input fill the available width. */
@media (max-width: 640px) {
    header .config-info {
        flex-direction: column;
        align-items: flex-start;
        gap: 8px;
        width: 100%;
    }

    header #reset-config-btn {
        margin-left: 0;
        margin-top: 4px;
        align-self: flex-end;
    }

    header .config-stack {
        width: 100%;
        /* don't let the stack expand to fill vertical space in column layout */
        flex: 0 0 auto;
    }

    header .student-id-container {
        align-self: stretch;
        width: 100%;
    }

    header .student-id-container input {
        width: 100%;
        box-sizing: border-box;
    }
}

.panel {
    background: var(--panel);
    padding: 12px;
    border-radius: 6px;
    box-shadow: 0 1px 2px rgba(0, 0, 0, .03)
}

#files {
    min-width: 220px
}

#code {
    width: 100%
}

.cm-editor {
    height: 320px;
    border: 1px solid #e6e6e9;
    border-radius: 4px
}

textarea#code {
    display: none
}

.tabs {
    display: flex;
    justify-content: space-between;
    align-items: center
}

.tabs .tab {
    background: #f4f6fb;
    border: 1px solid #e6e6e9;
    padding: 6px 10px;
    border-radius: 6px;
    display: inline-flex;
    align-items: center;
    gap: 8px
}

.tabs .tab.active {
    background: var(--accent);
    color: #fff
}

.tabs .tab .close {
    background: transparent;
    border: 0;
    color: inherit;
    cursor: pointer;
    padding: 0 6px
}

.tabs button#tab-new {
    background: #fff;
    border: 1px dashed #ccc;
    padding: 6px 10px;
    border-radius: 6px;
    cursor: pointer
}

/* Read-only file indicators */
.tabs .tab .tab-label.read-only {
    font-style: italic;
    opacity: 0.8;
}

.tabs .tab .read-only-indicator {
    font-size: 0.8em;
    opacity: 0.7;
    margin-left: 4px;
}

.editor-controls {
    margin-top: 8px
}

/* Editor controls layout */
.editor-controls {
    margin-top: 8px;
    display: flex;
    flex-direction: column;
    gap: 6px
}

.editor-actions {
    display: flex;
    gap: 8px;
    align-items: center
}

.stdin-row {
    display: flex;
    gap: 8px;
    align-items: center
}

.editor-meta {
    display: flex;
    align-items: center;
    margin-left: 12px
}

/* Button styles */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 6px 10px;
    border-radius: 6px;
    border: 1px solid #dfe6f7;
    background: #fff;
    color: #111;
    cursor: pointer;
    font-size: 0.93rem
}

.btn .icon {
    font-size: 18px;
    line-height: 1
}

.btn span {
    line-height: 1
}

.btn-primary {
    background: var(--accent);
    color: #fff;
    border-color: rgba(11, 92, 255, 0.9);
    margin-right: 5px;
}

.btn-danger {
    background: #fff;
    color: #b00020;
    border-color: #f1c0c6
}

.btn-ghost {
    background: transparent;
    border: 1px solid transparent
}

.btn-small {
    padding: 4px 8px;
    font-size: 0.85rem;
}

/* Snapshot modal: single-line snapshot items */
.snapshot-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    padding: 6px 8px;
    border-bottom: 1px solid #f1f3f7;
    white-space: nowrap;
}

.snapshot-item:last-child {
    border-bottom: 0
}

.snapshot-item>div {
    display: inline-flex;
    align-items: center;
    gap: 8px
}

.snapshot-item .snapshot-ts {
    font-weight: 600;
    margin-right: 6px
}

.snapshot-item .snapshot-meta {
    color: #666;
    font-size: 0.9em;
    white-space: nowrap
}

.snapshot-item .btn-small {
    padding: 6px 10px;
    font-size: 0.85rem;
}

.snapshot-item .btn-danger {
    border-color: #f1c0c6;
}

/* Reduce editor height so page fits without scrolling by default */
.cm-editor {
    height: 320px
}

/* CodeMirror styles for authoring page with proper JavaScript configuration */
.author-tab .CodeMirror {
    border: 1px solid var(--border);
    border-radius: 4px;
    box-sizing: border-box;
    min-height: 320px;
}

.author-tab .CodeMirror-gutters {
    background: #f4f6fb;
    border-right: 1px solid var(--border);
}

/* Scoped AST builder CodeMirror styles: basic styling with proper JavaScript configuration */
.ast-rule-builder .CodeMirror {
    border: 1px solid var(--border);
    border-radius: 4px;
    box-sizing: border-box;
    position: relative;
    min-height: 120px;
}

.ast-rule-builder .CodeMirror-gutters {
    background: #f4f6fb;
    border-right: 1px solid var(--border);
}

/* Error highlight for CodeMirror (marked by addLineClass 'cm-error-line') */
.cm-error-line {
    background: rgba(255, 69, 58, 0.06) !important;
}

/* Feedback click-to-highlight style (friendlier and more obvious) */
.cm-feedback-line {
    background: linear-gradient(90deg, rgba(198, 255, 208, 0.18), rgba(198, 255, 208, 0.08)) !important;
    border-left: 4px solid rgba(34, 197, 94, 0.9) !important;
    box-shadow: 0 2px 6px rgba(34, 197, 94, 0.06) inset;
}

/* Side tab UI */
.side-tabs {
    display: flex;
    gap: 6px;
    border-bottom: 1px solid #eee;
    padding-bottom: 8px;
    margin-bottom: 8px
}

.side-tab-btn {
    background: transparent;
    border: 0;
    padding: 6px 10px;
    border-radius: 6px;
    cursor: pointer;
    font-weight: 600;
    color: #444
}

/* Allow positioning of notification badge */
.side-tab-btn {
    position: relative;
}

/* Small pulsing badge to indicate new/unseen feedback */
.side-tab-btn.has-new-feedback::after {
    content: '';
    position: absolute;
    right: 0px;
    top: 0px;
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: var(--accent);
    border: 2px solid #fff;
    box-shadow: 0 0 0 4px rgba(11, 92, 255, 0.12);
    animation: ssg-tab-pulse 1.5s infinite ease-in-out;
}

@keyframes ssg-tab-pulse {
    0% {
        box-shadow: 0 0 0 0 rgba(11, 92, 255, 0.12);
    }

    70% {
        box-shadow: 0 0 0 6px rgba(11, 92, 255, 0);
    }

    100% {
        box-shadow: 0 0 0 0 rgba(11, 92, 255, 0);
    }
}

.side-tab-btn[aria-selected="true"] {
    background: var(--accent);
    color: #fff
}

.side-tab-content {
    display: block
}

.side-tab-content .panel-child {
    padding: 6px 0
}

/* Terminal styling: wrap long lines to avoid horizontal scrolling */
pre#terminal-output {
    height: 220px;
    overflow: auto;
    white-space: pre-wrap;
    /* allow wrapping */
    word-wrap: break-word;
    /* break long words */
    background: #0b1220;
    color: #d6f8ff;
    padding: 8px;
    border-radius: 4px;
    margin: 0;
}

/* Give the side panel a little more horizontal padding for readability */
#side {
    padding-left: 14px;
    padding-right: 14px
}

/* Terminal element styles (structured output) */
.terminal-output {
    font-family: monospace;
    background: #0b1220;
    color: #d6f8ff;
    padding: 8px;
    border-radius: 4px;
    min-height: 120px;
    max-height: 360px;
    overflow: auto
}

.terminal-line {
    white-space: pre-wrap;
    word-wrap: break-word;
    margin: 0;
    padding: 2px 0
}

.term-stdout {
    color: #d6f8ff
}

.term-stderr {
    color: #ffb3b3
}

/* Styling for stderr shown inside feedback/test modals (light background)
   Reuse monospace font, preserve whitespace, and use a subtle red tint. */
.test-stderr {
    background: #fff6f6;
    color: #8b1e1e;
    border: 1px solid rgba(139, 30, 30, 0.08);
    padding: 8px;
    border-radius: 4px;
    font-family: monospace;
    font-size: 0.95rem;
    white-space: pre-wrap;
    word-wrap: break-word;
}

/* Test results modal content: limit height and allow scrolling for long result lists */
.test-results-content {
    max-height: 56vh;
    /* match snapshot modal sensible max */
    overflow: auto;
    padding: 6px 2px;
}

.term-stdin {
    color: #bfe8b4
}

.term-runtime {
    color: #bfc7ff;
    font-style: italic
}

.term-input {
    display: flex;
    gap: 8px;
    align-items: center;
    margin-top: 8px
}

.term-input .prompt {
    color: #9aa6b2;
    font-family: monospace
}

.term-prompt-input {
    flex: 1;
    padding: 6px 8px;
    border-radius: 4px;
    border: 1px solid #e6e6e9;
    font-family: monospace
}

.term-prompt-input:focus {
    outline: 2px solid rgba(11, 92, 255, 0.15)
}

#autosave-indicator {
    margin-left: 12px;
    font-size: 0.9em;
    color: #666
}

.panel-child h2 {
    margin-top: 0
}

/* Feedback panel styling */
#fdbk-list,
#feedback-list {
    /* Prefer new id but keep legacy selector for compatibility */
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.feedback-section {
    border: 1px solid #eef2ff;
    background: #fbfdff;
    padding: 8px;
    border-radius: 6px;
}

.feedback-section h3 {
    margin: 0 0 6px 0;
    font-size: 0.95rem;
    color: #0b3a8a;
}

.feedback-entry {
    padding: 8px 10px;
    border-radius: 6px;
    background: transparent;
    display: flex;
    flex-direction: column;
    gap: 4px;
    cursor: pointer;
}

.feedback-entry:hover {
    background: rgba(11, 92, 255, 0.03);
}

.feedback-title {
    font-weight: normal;
    color: #0b3a8a;
    font-size: 0.95rem;
}

.feedback-msg {
    font-size: 0.9rem;
    color: #333;
    padding-left: 6px;
}

.feedback-msg-matched {
    color: #0b5cff;
    background: rgba(11, 92, 255, 0.04);
    border-left: 3px solid rgba(11, 92, 255, 0.12);
    padding: 6px 8px;
    border-radius: 4px;
}

.feedback-msg-hidden {
    color: #999;
    font-style: italic;
}

.feedback-edit-section .feedback-entry {
    border-left: 3px solid rgba(11, 92, 255, 0.06);
}

.feedback-run-section .feedback-entry {
    border-left: 3px solid rgba(11, 192, 120, 0.06);
}

/* Title row layout */
.feedback-title-row {
    display: flex;
    align-items: center;
    gap: 8px;
}

/* Tiny info icon with hover tooltip used in authoring modal labels */
.info-icon {
    position: relative;
    display: inline-flex;
    width: 18px;
    height: 18px;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    background: rgba(11, 92, 255, 0.06);
    color: var(--accent);
    font-size: 12px;
    line-height: 1;
    cursor: help;
}

.info-icon:focus {
    outline: 2px solid rgba(11, 92, 255, 0.18);
}

.info-icon .info-tooltip {
    display: none;
    position: absolute;
    left: 50%;
    top: calc(100% + 8px);
    transform: translateX(-50%);
    background: #fff;
    color: #111;
    border: 1px solid #eee;
    padding: 8px;
    border-radius: 6px;
    box-shadow: 0 6px 18px rgba(11, 92, 255, 0.08);
    white-space: normal;
    /* allow wrapping */
    max-width: 40vw;
    min-width: 10vw;
    word-wrap: break-word;
    z-index: 80;
    font-size: 0.85rem;
}

/* Show tooltip on hover and when user explicitly focuses via keyboard (focus-visible) */
.info-icon:hover .info-tooltip,
.info-icon:focus-visible .info-tooltip,
.info-icon:active .info-tooltip {
    display: block;
}


.feedback-icon {
    display: inline-flex;
    width: 20px;
    justify-content: center;
    align-items: center;
    font-size: 16px;
}

/* Severity color hints */
.severity-hint .feedback-icon {
    color: #9a6b00
}

.severity-info .feedback-icon {
    color: #0b5cff
}

.severity-warning .feedback-icon {
    color: #b06b00
}

.severity-success .feedback-iconf {
    color: #33aa22;
}

.matched-hint {
    color: #9a6b00
}

.matched-info {
    color: #0b5cff
}

.matched-warning {
    color: #b06b00
}

.matched-success {
    color: #33aa22;
}

/* Editor header layout: reserve space for autosave indicator to avoid layout shift */
.panel-header {
    display: flex;
    align-items: center;
    justify-content: space-between
}

.editor-header-meta {
    min-width: 120px;
    max-width: 250px;
    flex: 1 0 120px;
    color: #666;
    font-size: 0.95rem
}

.editor-header-meta span {
    display: inline-block;
    width: 100%;
    text-align: right
}

/* Add right padding so the autosave text lines up with the editor content's right edge */
.editor-header-meta {
    padding-right: 12px
}

/* Modal for snapshots */
.modal {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, .4);
    align-items: center;
    justify-content: center
}

.modal[aria-hidden="false"] {
    display: flex
}

.modal-content {
    background: var(--panel);
    padding: 5px 10px;
    /* Remove padding since header/body will handle their own */
    border-radius: 6px;
    max-width: 720px;
    width: 90%;
    /* Ensure modal content doesn't overflow the viewport; allow internal scrolling when tall */
    max-height: 80vh;
    overflow: hidden;
    /* Let the body handle scrolling */
    display: flex;
    flex-direction: column;
}

/* Modal content body - scrollable area */
.modal-body {
    flex: 1;
    overflow-y: auto;
    overflow-x: hidden;
    padding: 0;
    /* Remove padding since content inside will have its own padding */
    min-height: 0;
    /* Important for flex containers to allow shrinking */
}

/* Load drafts modal: ensure proper overflow handling with new structure */
#load-drafts-modal .modal-content {
    display: flex;
    flex-direction: column;
    max-height: 80vh;
}

#load-drafts-modal .modal-body {
    flex: 1;
    overflow: visible;
    min-height: 0;
}

#load-drafts-modal #load-drafts-content {
    max-height: 400px;
    overflow-y: auto;
}

/* Snapshot list container: limit height and allow scrolling when many snapshots exist */
#snapshot-list {
    max-height: 56vh;
    /* responsive sensible maximum */
    overflow: auto;
    border: 1px solid #eee;
    padding: 6px;
    border-radius: 6px;
    background: #fff;
}

/* Config server list: when many configs exist make this area scrollable */
.config-server-list {
    max-height: 40vh;
    overflow: auto;
    border: 1px solid #eee;
    padding: 8px;
    margin-top: 6px;
    border-radius: 6px;
    background: #fff;
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 12px 8px 12px;
    /* Add padding since modal-content padding was removed */
    margin-bottom: 0;
    /* Remove margin since we're using padding */
    border-bottom: 1px solid var(--border);
    background: var(--panel);
    /* Ensure consistent background */
    border-radius: 6px 6px 0 0;
    /* Match modal border radius */
    /* Sticky positioning */
    position: sticky;
    top: 0;
    z-index: 10;
    /* Prevent shrinking */
    flex-shrink: 0;
}

.modal-header h3 {
    margin: 0;
    font-size: 16px;
    color: var(--text);
}

.modal-config-info {
    font-size: 11px;
    color: var(--text-disabled);
    font-family: monospace;
    background: var(--editor-bg);
    padding: 2px 6px;
    border-radius: 3px;
    border: 1px solid var(--border);
}

.modal-actions {
    display: flex;
    justify-content: flex-end;
    margin-top: 12px
}

/* Shared class for modal Close buttons to ensure consistent styling */
.modal-close-btn {
    /* keep same base button appearance but allow centralized tweaks */
    font-weight: 600;
    padding: 6px 10px;
    border-radius: 6px;
}

/* Drag and drop styling for config modal */
.modal.drag-over {
    background: rgba(0, 123, 255, 0.1);
    border: 2px dashed #007bff;
}

.modal.drag-over .modal-content {
    background: rgba(255, 255, 255, 0.95);
}

.snapshot-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    padding: 6px 8px;
    border-bottom: 1px solid #eee;
    white-space: nowrap;
}

.snapshot-item:last-child {
    border-bottom: 0
}

.snapshot-ts {
    font-weight: 600;
    margin-right: 8px
}

.snapshot-meta {
    color: var(--text-disabled);
    font-size: 0.9em;
    font-family: monospace
}

/* Mid area truncation to keep single-line layout */
.snapshot-mid {
    display: flex;
    align-items: center;
    gap: 8px;
    flex: 1 1 auto;
    min-width: 0;
    /* allow flex child to shrink */
    overflow: hidden;
}

/* Ensure actions container stays to the right and doesn't shrink */
.snapshot-item>div:last-child {
    flex: 0 0 auto;
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.snapshot-mid .snapshot-ts {
    flex: 0 0 auto
}

.snapshot-mid .snapshot-meta {
    flex: 1 1 auto;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap
}

/* Snapshot action buttons now use textual Load/Delete buttons styled via .btn-small */

/* File editor modal */
.file-modal .modal-content {
    max-width: 820px
}

.files-list {
    max-height: 360px;
    overflow: auto;
    border: 1px solid #eee;
    padding: 8px;
    border-radius: 4px
}

.file-row {
    display: flex;
    justify-content: space-between;
    padding: 6px;
    border-bottom: 1px solid #fafafa
}

.file-name {
    font-family: monospace
}

.file-actions button {
    margin-left: 8px
}

/* Authoring page overrides: ensure the authoring tab strip and panels
   occupy the full width and are not affected by the site's column grid. */
.author-tabs {
    width: 100%;
}

.author-tabs>div {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.author-tab {
    width: 100%;
    margin-top: 12px;
}

/* Visual active state for author tab buttons */
.tab-btn.active {
    background: var(--accent);
    color: #fff;
}

/* Author tab visibility: hide panels by default and show when active
   JS will toggle the "active" class on the visible panel. This avoids
   fighting inline styles and keeps the behavior deterministic. */
.author-tab {
    display: none;
}

.author-tab.active {
    display: block;
}

/* Styling for Markdown-rendered code blocks inside the Instructions panel and author preview */
#instructions-content pre,
#instructions-preview pre {
    padding: 12px;
    border-radius: 6px;
    overflow: auto;
    font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, 'Roboto Mono', 'Courier New', monospace;
    font-size: 0.95rem;
    line-height: 1.45;
    margin: 12px 0;
    box-shadow: 0 6px 18px rgba(11, 92, 255, 0.04) inset;
    border: 1px solid rgba(11, 92, 255, 0.12);
    border-left: 4px solid rgba(11, 92, 255, 0.12);
}

#instructions-content pre code,
#instructions-preview pre code {
    background: transparent;
    color: inherit;
    padding: 0;
    border-radius: 0;
}

#instructions-content code,
#instructions-preview code {
    background: #f4f6f8;
    padding: 2px 6px;
    border-radius: 4px;
    font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, 'Roboto Mono', 'Courier New', monospace;
    font-size: 0.95em;
}

/* Ensure test compare blocks share the same code block styling as the instructions preview
   but render as plain text (no language class) so they won't be syntax-highlighted. */
.test-compare pre {
    padding: 12px;
    border-radius: 6px;
    overflow: auto;
    font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, 'Roboto Mono', 'Courier New', monospace;
    font-size: 0.95rem;
    line-height: 1.45;
    margin: 12px 0;
    box-shadow: 0 6px 18px rgba(11, 92, 255, 0.04) inset;
    border: 1px solid rgba(11, 92, 255, 0.12);
    border-left: 4px solid rgba(11, 92, 255, 0.12);
    background: #fff;
}

.test-compare pre code,
.test-compare code {
    background: transparent;
    color: inherit;
    padding: 0;
    border-radius: 0;
    white-space: pre-wrap;
}

.test-compare code {
    background: #f4f6f8;
    padding: 2px 6px;
    border-radius: 4px;
    font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, 'Roboto Mono', 'Courier New', monospace;
    font-size: 0.95em;
}

/* AST Pattern Builder Styles */
.ast-pattern-builder {
    margin: 8px 0;
}

.ast-pattern-builder .ast-preview {
    font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, 'Roboto Mono', 'Courier New', monospace;
}

.ast-tester {
    margin-top: 12px;
}

.ast-tester textarea {
    font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, 'Roboto Mono', 'Courier New', monospace;
    border: 1px solid #ddd;
    border-radius: 4px;
    padding: 8px;
    resize: vertical;
}

.ast-tester .test-result {
    font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, 'Roboto Mono', 'Courier New', monospace;
}

.ast-tester .test-result pre {
    background: transparent;
    margin: 8px 0 0 0;
    padding: 0;
    border: none;
    font-size: 0.85em;
    max-height: 200px;
    overflow: auto;
}

.btn-secondary {
    background: #6c757d;
    color: white;
    border: 1px solid #6c757d;
}

.btn-secondary:hover {
    background: #5a6268;
    border-color: #545b62;
}

.matcher-examples {
    background: #f8f9fa;
    border: 1px solid #e9ecef;
    border-radius: 4px;
    padding: 8px;
}

.matcher-examples code {
    background: #e9ecef;
    padding: 2px 4px;
    border-radius: 3px;
    font-size: 0.85em;
}

/* Verification panel in author page */
#verification-panel-title {
    margin-bottom: 5px;
}

#verification-config-id {
    margin-bottom: 8px;
}

/* Read-only indicators */
.readonly-indicator {
    font-size: 11px;
    color: #666;
    margin-left: 5px;
    font-weight: normal;
}

.tab.readonly::after {
    content: "🔒";
    margin-left: 4px;
    font-size: 10px;
    opacity: 0.7;
}

/* Read-only editor styling */
.cm-readonly {
    background-color: #f8f8f8 !important;
}

.cm-readonly .CodeMirror-cursor {
    display: none !important;
}

.cm-readonly .CodeMirror-code {
    opacity: 0.8;
}