:root {
    --cf-primary:     #1150E6;
    --cf-dark:        #1a1a2e;
    --cf-card-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    --cal-empty:      #ebedf0;
    --cal-1:          #9be9a8;
    --cal-2:          #40c463;
    --cal-3:          #216e39;
}

/* ── Navbar ───────────────────────────────────────── */
.navbar-brand { letter-spacing: .5px; }

.avatar-initials {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: #40c463;
    color: #fff;
    font-size: 12px;
    font-weight: 700;
    margin-right: 4px;
}

/* ── Cards ────────────────────────────────────────── */
.card {
    box-shadow: var(--cf-card-shadow);
    border: 1px solid rgba(0, 0, 0, .07);
}

/* ── Problem list ─────────────────────────────────── */
.problem-row { transition: background-color .15s; }
.problem-row:hover { background-color: #E4ECFF; }

/* ── Category pill sidebar ────────────────────────── */
.category-pill {
    display: block;
    padding: .45rem 1rem;
    border-radius: 2rem;
    color: #495057;
    text-decoration: none;
    margin-bottom: .25rem;
    font-size: .9rem;
    transition: background-color .15s, color .15s;
}
.category-pill:hover,
.category-pill.active {
    background-color: var(--cf-primary);
    color: #fff;
}

/* ── Difficulty badges (5-level scale) ────────────── */
.badge-easy   { background-color: #198754; }
.badge-medium { background-color: #fd7e14; }
.badge-hard   { background-color: #dc3545; }

.badge-diff-easy         { background-color: #198754; color: #fff; }
.badge-diff-intermediate { background-color: #20c997; color: #fff; }
.badge-diff-medium       { background-color: #fd7e14; color: #fff; }
.badge-diff-hard         { background-color: #dc3545; color: #fff; }
.badge-diff-extreme      { background-color: #6f42c1; color: #fff; }

/* ── Language badge ───────────────────────────────── */
.lang-badge {
    background-color: #E4ECFF;
    color: #1150E6;
    border: 1px solid #C3D4FF;
    font-weight: 600;
}

/* ── Leaderboard ──────────────────────────────────── */
.rank-pill {
    background: #f3c14b;
    color: #5a4500;
    border-radius: 2rem;
    padding: .4em .9em;
    font-weight: 700;
}
.medal { font-size: 1.4rem; }

/* ── Discussion thread badges ─────────────────────── */
.thread-badge { font-weight: 600; }
.thread-public     { background-color: #1150E6; color: #fff; }
.thread-classroom  { background-color: #20c997; color: #fff; }
.thread-one_on_one { background-color: #6f42c1; color: #fff; }

.reply-card { border-left: 3px solid #e9ecef; }

/* ── Hero (home) ──────────────────────────────────── */
.hero { padding: 4rem 0 3rem; text-align: center; }
.hero h1 { font-size: 2.8rem; font-weight: 700; }

/* ── Search bar ───────────────────────────────────── */
#search-input:focus {
    box-shadow: 0 0 0 .2rem rgba(13, 110, 253, .25);
    border-color: var(--cf-primary);
}

/* ── Empty state ──────────────────────────────────── */
.empty-state {
    padding: 3rem;
    text-align: center;
    color: #6c757d;
}

/* ══════════════════════════════════════════════════
   PROFILE PAGE
══════════════════════════════════════════════════ */

/* Profile header */
.profile-header { border-left: 5px solid var(--cf-primary); }
.profile-header .card-body {
    display: flex;
    align-items: center;
    gap: 1rem;
}
.profile-header .btn-primary {
    margin-left: auto;
    white-space: nowrap;
}

.profile-avatar {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    background: linear-gradient(135deg, #40c463, #216e39);
    color: #fff;
    font-size: 2rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.role-badge { font-size: .85rem; padding: .35em .75em; border-radius: 2rem; }
.role-badge.role-admin   { background: #dc3545; color: #fff; }
.role-badge.role-teacher { background: #1150E6; color: #fff; }
.role-badge.role-student { background: #198754; color: #fff; }

/* ── Difficulty progress ring (LeetCode-style) ───── */
.cf-ring-wrap {
    position: relative;
    width: 175px;
    height: 175px;
    flex-shrink: 0;
}
.cf-ring { width: 100%; height: 100%; }
.cf-ring circle {
    fill: none;
    stroke-width: 10;
    stroke-linecap: round;
}
.cf-ring-track { stroke: #e9ecef; }
.cf-ring-label {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    pointer-events: none;
}
.cf-ring-num {
    font-size: 1.9rem;
    font-weight: 800;
    line-height: 1.1;
    color: #212529;
}
.cf-ring-total {
    font-size: 1rem;
    font-weight: 600;
    color: #6c757d;
}
.cf-ring-solved { font-size: .85rem; font-weight: 600; }
.cf-ring-attempting { font-size: .76rem; color: #6c757d; margin-top: 2px; }

/* Hovering the ring swaps solved-progress for the acceptance-rate view:
   the ring re-fills to the acceptance % of the full circle. */
.cf-ring-diff,
.cf-ring-label-main,
.cf-ring-acc,
.cf-ring-label-acc { transition: opacity .18s ease-in-out; }
.cf-ring-acc,
.cf-ring-label-acc { opacity: 0; }
.cf-ring-wrap:hover .cf-ring-diff,
.cf-ring-wrap:hover .cf-ring-label-main { opacity: 0; }
.cf-ring-wrap:hover .cf-ring-acc,
.cf-ring-wrap:hover .cf-ring-label-acc { opacity: 1; }

/* One slim row per difficulty: name | bar | count (links to the catalogue) */
.cf-diff-list {
    display: flex;
    flex-direction: column;
    gap: .3rem;
    flex: 1 1 185px;
    min-width: 185px;
    max-width: 300px;
}
.cf-diff-row {
    display: grid;
    grid-template-columns: 3.2rem 1fr auto;
    align-items: center;
    gap: .6rem;
    padding: .3rem .5rem;
    border-radius: 8px;
    text-decoration: none;
    transition: background .12s ease-in-out;
}
.cf-diff-row:hover { background: #f1f3f5; }
.cf-diff-name { font-size: .74rem; font-weight: 700; }
.cf-diff-count {
    font-size: .82rem;
    font-weight: 700;
    color: #212529;
    white-space: nowrap;
}
.cf-diff-total { font-weight: 600; color: #6c757d; }

/* Shared slim progress bar (difficulty rows + category rows) */
.cf-bar {
    display: block;
    height: 8px;
    border-radius: 6px;
    background: #e9ecef;
    overflow: hidden;
}
.cf-bar-fill {
    display: block;
    height: 100%;
    border-radius: 6px;
}

/* Quick-stats strip under the progress ring */
.cf-stat-tiles {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: .6rem;
}
.cf-stat-tile {
    background: #f8f9fa;
    border: 1px solid #e9ecef;
    border-radius: 10px;
    padding: .45rem .3rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    line-height: 1.3;
    text-align: center;
}
.cf-stat-ico { font-size: .95rem; }
.cf-stat-val { font-size: 1.05rem; font-weight: 800; color: #212529; }
.cf-stat-lbl {
    font-size: .66rem;
    font-weight: 600;
    color: #6c757d;
    text-transform: uppercase;
    letter-spacing: .05em;
}

/* Category list: scrolls when there are many categories */
.cf-cat-scroll {
    display: flex;
    flex-direction: column;
    gap: .3rem;
    max-height: 320px;
    overflow-y: auto;
    padding-right: .35rem;
    scrollbar-width: thin;
}
.cf-cat-scroll::-webkit-scrollbar { width: 6px; }
.cf-cat-scroll::-webkit-scrollbar-thumb { background: #ced4da; border-radius: 3px; }
.cf-cat-row {
    display: block;
    padding: .45rem .55rem;
    border-radius: 8px;
    text-decoration: none;
    color: inherit;
    transition: background .12s ease-in-out;
}
.cf-cat-row:hover { background: #f1f3f5; }

/* ── Skills panel ─────────────────────────────────── */
.cf-skill-tier {
    font-size: .78rem;
    font-weight: 700;
    color: #495057;
    display: flex;
    align-items: center;
    gap: .4rem;
}
.cf-skill-dot {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    display: inline-block;
}
.cf-skill-chip {
    background: #f1f3f5;
    border-radius: 2rem;
    padding: .25rem .7rem;
    font-size: .8rem;
    font-weight: 600;
    color: #343a40;
}
.cf-skill-count { color: #6c757d; font-weight: 500; }

/* ── Donut chart wrapper ──────────────────────────── */
.donut-wrap {
    position: relative;
    width: 180px;
    height: 180px;
    margin: 0 auto;
}
.donut-label {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    pointer-events: none;
}
.donut-number {
    font-size: 2rem;
    font-weight: 700;
    line-height: 1;
    color: #212529;
}
.donut-sub {
    font-size: .9rem;
    color: #6c757d;
}

/* ── Stat boxes (admin / teacher) ─────────────────── */
.stat-box {
    background: #f8f9fa;
    border-radius: 12px;
    padding: 1rem .5rem;
}
.stat-number {
    font-size: 1.9rem;
    font-weight: 700;
    line-height: 1;
}
.stat-label {
    font-size: .75rem;
    color: #6c757d;
    margin-top: .35rem;
}

/* ══════════════════════════════════════════════════
   ACTIVITY CALENDAR
══════════════════════════════════════════════════ */

.calendar-outer {
    display: flex;
    align-items: flex-start;
    gap: 6px;
    overflow-x: auto;
    padding-bottom: 6px;
}

/* Calendar + side-stats layout */
.cf-activity-row {
    display: flex;
    align-items: stretch;
    gap: 24px;
    flex-wrap: wrap;
}
/* Sized to the grid's own width rather than growing: any extra width past the
   52 weeks is dead space inside this box, so hand it to the stats instead.
   min-width:0 still lets the grid shrink and scroll when space is tight. */
.cf-activity-row > .calendar-outer {
    min-width: 0;
    flex: 0 1 auto;
}
/* Takes the width the calendar leaves over. The floor is the width the five
   tiles need to stay legible — below it the panel wraps to its own full-width
   row under the calendar rather than squeezing the tiles into slivers. */
.cf-activity-side {
    flex: 1 1 600px;
    min-width: 600px;
    display: flex;
    align-items: stretch;
    gap: 10px;
}
/* Un-boxes the 4-stat grid so its tiles sit inline with the highlight tile,
   making the whole side panel a single row matched to the calendar's height. */
.cf-activity-grid { display: contents; }
.cf-activity-stat {
    flex: 1 1 0;
    min-width: 0;
    background: var(--cf-surface-2, rgba(127, 127, 127, .06));
    border: 1px solid var(--cf-border, rgba(127, 127, 127, .18));
    border-radius: 12px;
    padding: 14px 12px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    text-align: center;
    gap: 4px;
}
.cf-activity-highlight {
    flex: 1.6 1 0;
    background: var(--cf-primary-light, rgba(10, 102, 194, .1));
    border-color: var(--cf-primary, #0A66C2);
}
.cf-activity-lbl {
    font-size: .68rem;
    text-transform: uppercase;
    letter-spacing: .06em;
    color: var(--cf-text-muted, #767676);
    font-weight: 600;
    line-height: 1.3;
}
.cf-activity-day {
    font-size: 1.1rem;
    font-weight: 700;
    letter-spacing: -.3px;
}
.cf-activity-nums {
    display: flex;
    align-items: baseline;
    justify-content: center;
    flex-wrap: wrap;
    gap: 4px 6px;
    font-size: .9rem;
}
.cf-activity-nums strong { color: var(--cf-primary, #0A66C2); }
.cf-activity-dot { color: var(--cf-text-muted, #767676); }
.cf-activity-big {
    font-size: 1.5rem;
    font-weight: 800;
    letter-spacing: -.5px;
    line-height: 1.1;
    color: var(--cf-primary, #0A66C2);
}
@media (max-width: 767px) {
    /* min-width must drop too, or the 600px floor forces a page-wide scrollbar. */
    .cf-activity-side { flex-basis: 100%; min-width: 0; flex-wrap: wrap; }
    .cf-activity-highlight { flex-basis: 100%; }
}

/* Day-of-week labels column */
.cal-day-labels {
    display: grid;
    grid-template-rows: repeat(7, 13px);
    gap: 3px;
    margin-top: 22px; /* align with cells below month labels */
    flex-shrink: 0;
}
.cal-day-labels span {
    font-size: 10px;
    color: #767676;
    line-height: 13px;
    text-align: right;
    white-space: nowrap;
}

/* The area with month labels + grid. The trailing month label is absolutely
   positioned and paints past the final column, so reserve room for it — without
   this it overflows .calendar-outer (now content-sized) into a stray scrollbar. */
.cal-area { flex-shrink: 0; padding-right: 28px; }

/* Grid: columns = weeks, rows = days, filled column-by-column */
.cal-grid {
    display: grid;
    grid-template-rows: repeat(7, 13px);
    grid-auto-flow: column;
    grid-auto-columns: 13px;
    gap: 3px;
}

/* Individual day cell */
.cal-cell {
    width: 13px;
    height: 13px;
    border-radius: 2px;
    cursor: default;
    transition: opacity .1s;
}
.cal-cell:hover { opacity: .75; }

.shade-0     { background: var(--cal-empty); }
.shade-1     { background: var(--cal-1); }
.shade-2     { background: var(--cal-2); }
.shade-3     { background: var(--cal-3); }
.shade-empty { background: transparent; }

/* ══════════════════════════════════════════════════
   CATALOGUE — clickable problem title
══════════════════════════════════════════════════ */
.problem-title-link {
    color: #212529;
    text-decoration: none;
}
.problem-title-link:hover {
    color: var(--cf-primary);
    text-decoration: underline;
}

/* ══════════════════════════════════════════════════
   PROBLEM PAGE
══════════════════════════════════════════════════ */

/* Top bar: title + meta badges */
.problem-topbar {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: .5rem;
}

/* Solved badge */
.solved-badge {
    background: #198754;
    color: #fff;
    font-size: .85rem;
    padding: .35em .8em;
    border-radius: 2rem;
}

/* Two-panel grid */
.problem-panels {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
    /* Use viewport height so both panels fill the screen without page scroll */
    height: calc(100vh - 140px);
    min-height: 500px;
}

/* Left panel scrolls internally */
.problem-left {
    overflow: hidden;
    display: flex;
    flex-column: column;
    flex-direction: column;
}

/* Tab body scrolls */
.problem-tab-body {
    flex: 1;
    overflow-y: auto;
}

/* Problem statement text */
.problem-statement p {
    margin-bottom: .6rem;
    line-height: 1.7;
}

/* Section headings inside description */
.section-label {
    text-transform: uppercase;
    letter-spacing: .06em;
    font-size: .72rem;
    color: var(--cf-text-muted);
    font-weight: 700;
    margin-bottom: .6rem;
}

/* Example blocks (theme tokens so dark mode re-tints them automatically) */
.example-block {
    background: var(--cf-surface-2);
    border-left: 3px solid var(--cf-border-strong);
    border-radius: 0 6px 6px 0;
    padding: .75rem 1rem;
    font-size: .9rem;
}
.example-row {
    display: flex;
    gap: .75rem;
    margin-bottom: .3rem;
    align-items: baseline;
}
.example-row:last-child { margin-bottom: 0; }
.example-key {
    flex-shrink: 0;
    width: 6rem;
    font-weight: 600;
    font-size: .78rem;
    color: var(--cf-text-muted);
    text-transform: uppercase;
    letter-spacing: .04em;
}
.example-val {
    font-family: 'SFMono-Regular', Consolas, 'Liberation Mono', Menlo, monospace;
    font-size: .85rem;
    background: transparent;
    color: var(--cf-text);
    padding: 0;
    word-break: break-all;
}

/* Constraints list */
.constraint-list {
    padding-left: 1.2rem;
    font-size: .9rem;
    line-height: 1.8;
    color: var(--cf-text);
}

/* Hint items (dark override lives in theme.css §16) */
.hint-item .hint-body {
    background: #fffbea;
    border: 1px solid #fde68a;
    border-radius: 6px;
    padding: .6rem .9rem;
    font-size: .9rem;
    margin-top: .3rem;
}

/* Public solutions tab */
.pubsol {
    border: 1px solid var(--cf-border);
    border-radius: 8px;
    overflow: hidden;
}
.pubsol-head {
    display: flex;
    align-items: center;
    gap: .5rem;
    border: none;
    background: var(--cf-surface-2);
    color: var(--cf-text);
    padding: .55rem .9rem;
    font-size: .88rem;
    cursor: pointer;
}
.pubsol-head:hover { background: var(--cf-primary-light); }
.pubsol-head .pubsol-arrow { color: var(--cf-text-faint); font-size: .8rem; }

/* "Your solution" row: the publish switch sits beside the collapse button,
   so the row (not the button) carries the surface colour. */
.pubsol-mine { border-color: var(--cf-primary-light); }
.pubsol-mine-head { background: var(--cf-surface-2); }
.pubsol-mine-head .pubsol-head { background: transparent; }
.pubsol-mine-head .pubsol-head:hover { background: var(--cf-primary-light); }
/* Scoped under .pubsol for the same reason: Prism adds language-* classes to
   this <pre> when highlighting, and the theme CSS must not restyle it. */
.pubsol .pubsol-code {
    background: #1e1e2e;
    color: #cdd6f4;
    padding: .75rem 1rem;
    margin: 0;
    border-radius: 0;
    font-size: .82rem;
    line-height: 1.6;
    overflow-x: auto;
    tab-size: 4;
}
.pubsol .pubsol-code code {
    background: transparent;
    color: inherit;
    padding: 0;
    font-family: inherit;
    font-size: inherit;
    text-shadow: none;
}

/* Publish/unpublish toggle (My Submissions "Share" column + post-submit prompt) */
.vis-toggle {
    font-size: .72rem;
    padding: .1rem .55rem;
    border-radius: 99px;
    border: 1px solid var(--cf-border-strong);
    background: var(--cf-warning-light);
    color: inherit;
}
.vis-toggle.is-public {
    background: var(--cf-success-light);
    border-color: var(--cf-success);
}

/* ── Right panel ── */
.problem-right {
    overflow: hidden;
    min-height: 0;
}

/* Drag handle between the editor card and the results card */
.panel-resizer {
    flex: 0 0 auto;
    height: 12px;
    margin: -0.45rem 0;          /* sit inside the flex gap instead of adding to it */
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: row-resize;
    touch-action: none;          /* needed so pointer-drag works on touch screens */
    user-select: none;
}
.panel-resizer span {
    width: 64px;
    height: 5px;
    border-radius: 99px;
    background: var(--cf-border-strong);
    transition: background var(--cf-dur-fast, .15s) ease;
}
.panel-resizer:hover span,
.panel-resizer.dragging span { background: var(--cf-primary); }

/* Editor toolbar */
.editor-toolbar {
    background: #1e1e2e;
    border-radius: 6px 6px 0 0;
    color: #cdd6f4;
}
.editor-toolbar .form-select {
    background-color: #313244;
    color: #cdd6f4;
    border-color: #45475a;
    font-size: .82rem;
}

/* Code editor: a transparent textarea stacked over a Prism-highlighted <pre>.
   Both share identical font metrics + padding so the glyphs line up exactly;
   the textarea keeps the caret/selection, the <pre> supplies the colours. */
.editor-stack {
    position: relative;
    width: 100%;
    height: 100%;
}
.code-editor {
    position: relative;
    z-index: 1;
    width: 100%;
    height: 100%;
    background: transparent;
    color: transparent;          /* colours come from the highlight layer */
    caret-color: #cdd6f4;
    font-family: 'SFMono-Regular', Consolas, 'Liberation Mono', Menlo, monospace;
    font-size: .85rem;
    line-height: 1.6;
    border: none;
    resize: none;
    padding: .75rem 1rem .75rem 3.5rem;
    outline: none;
    tab-size: 4;
    white-space: pre;
    overflow: auto;
}
.code-editor:focus { outline: none; box-shadow: none; }
.code-editor::selection { background: rgba(147,153,178,.35); }
/* Scoped under .editor-stack so these always beat the Prism theme's own
   pre[class*="language-"] / code[class*="language-"] rules. */
.editor-stack .editor-highlight {
    position: absolute;
    inset: 0;
    margin: 0;
    border: none;
    border-radius: 0;
    box-shadow: none;
    padding: .75rem 1rem .75rem 3.5rem;
    background: transparent;
    color: #cdd6f4;
    font-family: 'SFMono-Regular', Consolas, 'Liberation Mono', Menlo, monospace;
    font-size: .85rem;
    line-height: 1.6;
    tab-size: 4;
    white-space: pre;
    overflow: hidden;            /* scroll position mirrored from the textarea */
    pointer-events: none;
}
.editor-stack .editor-highlight code {
    font: inherit;
    color: inherit;
    background: transparent;
    padding: 0;
    margin: 0;
    white-space: inherit;
    text-shadow: none;
}

/* Editor area: position the line-number overlay */
.editor-area {
    background: #1e1e2e;
    min-height: 0;
    overflow: hidden;
}
/* Autocomplete popup (always over the dark editor, both site themes) */
.cf-ac-menu {
    position: absolute;
    z-index: 5;
    min-width: 130px;
    max-width: 260px;
    background: #313244;
    border: 1px solid #45475a;
    border-radius: 8px;
    padding: 3px;
    box-shadow: 0 8px 20px rgba(0, 0, 0, .45);
    font-family: 'SFMono-Regular', Consolas, 'Liberation Mono', Menlo, monospace;
    font-size: .8rem;
    overflow: hidden;
}
.cf-ac-item {
    padding: .22rem .6rem;
    border-radius: 5px;
    color: #cdd6f4;
    cursor: pointer;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.cf-ac-item.is-active,
.cf-ac-item:hover { background: #45475a; color: #fff; }

/* Autocomplete switch in the dark editor toolbar */
.cf-ac-switch .form-check-label { color: #cdd6f4; cursor: pointer; user-select: none; }
.cf-ac-switch .form-check-input { cursor: pointer; background-color: #45475a; border-color: #585b70; }
.cf-ac-switch .form-check-input:checked { background-color: #1150E6; border-color: #1150E6; }

.editor-lines {
    position: absolute;
    top: 0;
    left: 0;
    z-index: 2;
    width: 2.8rem;
    padding: .75rem 0;
    text-align: right;
    font-family: 'SFMono-Regular', Consolas, monospace;
    font-size: .85rem;
    line-height: 1.6;
    color: #6c7086;
    background: #181825;
    pointer-events: none;
    white-space: pre;
    overflow: hidden;
    height: 100%;
}

/* Editor action bar */
.editor-actions {
    background: #1e1e2e;
    border-radius: 0 0 6px 6px;
    border-top-color: #313244 !important;
}
.editor-actions .btn-outline-success {
    border-color: #a6e3a1;
    color: #a6e3a1;
}
.editor-actions .btn-outline-success:hover {
    background: #a6e3a1;
    color: #1e1e2e;
}
.editor-actions .btn-success {
    background: #a6e3a1;
    border-color: #a6e3a1;
    color: #1e1e2e;
    font-weight: 600;
}
.editor-actions .btn-success:hover {
    background: #8bd5a8;
}

/* Test case tabs */
.tc-tab {
    font-size: .8rem;
    padding: .2rem .7rem;
    border-color: var(--cf-border-strong);
    color: var(--cf-text-muted);
    border-radius: 1rem;
}
.tc-tab.active {
    background: var(--cf-primary);
    color: #fff;
    border-color: var(--cf-primary);
}
.tc-label {
    display: block;
    font-size: .72rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: .05em;
    color: var(--cf-text-muted);
    margin-bottom: .3rem;
}
.tc-expected {
    background: var(--cf-surface-2);
    border: 1px solid var(--cf-border);
    color: var(--cf-text);
    font-family: monospace;
    min-height: 1.8rem;
}
.tc-console {
    background: #1e1e2e;
    color: #cdd6f4;
    border-radius: 6px;
    padding: .6rem .9rem;
    min-height: 3rem;
    white-space: pre;
    overflow-x: auto;
}

/* ══════════════════════════════════════════════════
   CLASSROOMS
══════════════════════════════════════════════════ */

/* Compact code chip on the classroom card */
.classroom-code-display {
    display: inline-flex;
    flex-direction: column;
    align-items: flex-start;
}
.code-label {
    font-size: .65rem;
    font-weight: 700;
    letter-spacing: .08em;
    color: #6c757d;
    text-transform: uppercase;
    margin-bottom: .15rem;
}
.code-value {
    font-family: 'SFMono-Regular', Consolas, 'Liberation Mono', Menlo, monospace;
    font-size: 1.25rem;
    font-weight: 700;
    letter-spacing: .18em;
    color: var(--cf-primary);
    background: #E4ECFF;
    border: 1.5px solid #C3D4FF;
    border-radius: 6px;
    padding: .25em .65em;
}

/* Large code shown in classroom detail */
.classroom-code-hero {
    font-family: 'SFMono-Regular', Consolas, 'Liberation Mono', Menlo, monospace;
    font-size: 2rem;
    font-weight: 700;
    letter-spacing: .22em;
    color: var(--cf-primary);
    background: #E4ECFF;
    border: 2px solid #C3D4FF;
    border-radius: 10px;
    padding: .4em .8em;
    display: inline-block;
}

/* Flex items default to min-width:auto, so a text-truncate child can force
   them wider than their card and spill text out of the box. Templates put
   .min-width-0 on such items (dashboards, home sections, quiz lists) —
   Bootstrap has no such utility, so it's defined here. */
.min-width-0 { min-width: 0; }

/* Responsive: stack panels on narrow screens */
@media (max-width: 900px) {
    .problem-panels {
        grid-template-columns: 1fr;
        height: auto;
    }
    .problem-left  { height: 55vh; }
    .problem-right { height: auto; }
    .code-editor   { height: 300px; }
}
