/* Code Lab: Build with AI (founder request, 2026-10-04). A chat panel above the editor tabs. */
.lab-editor > .lab-editor-bar { flex-shrink: 0; } /* the Ask AI row must not be squeezed under the chat */
.lab-build[hidden] { display: none !important; } /* hidden from users (founder 2026-10-07); code-lab-build.js shows it to admin preview / launch group buildai */
.lab-build { flex: 0 0 auto; border-bottom: 1px solid var(--border); background: color-mix(in srgb, var(--accent) 6%, var(--bg-elevated)); }
.lab-build > summary { display: flex; align-items: center; gap: 10px; padding: 10px 14px; cursor: pointer; list-style: none; font: 700 0.92rem var(--font-body, inherit); color: var(--text); }
.lab-build > summary::-webkit-details-marker { display: none; }
.lab-build-ic { display: inline-grid; place-items: center; width: 26px; height: 26px; border-radius: 8px; color: #fff; background: linear-gradient(135deg, var(--accent), var(--accent-2)); flex-shrink: 0; }
.lab-build-ic svg { width: 15px; height: 15px; }
.lab-build-sub { margin-left: auto; font-weight: 500; font-size: 0.78rem; color: var(--text-muted); white-space: nowrap; }
.lab-build-chev { width: 16px; height: 16px; color: var(--text-muted); transition: transform 0.15s ease; flex-shrink: 0; }
.lab-build[open] .lab-build-chev { transform: rotate(180deg); }
.lab-build-body { padding: 0 14px 12px; }
.lab-build-thread { display: flex; flex-direction: column; gap: 8px; max-height: 150px; overflow-y: auto; margin-bottom: 10px; scroll-behavior: smooth; }
.lab-build-thread:empty { display: none; }
.lab-build-msg { max-width: 88%; padding: 8px 12px; border-radius: 14px; font-size: 0.86rem; line-height: 1.45; overflow-wrap: anywhere; white-space: pre-line; }
.lab-build-msg.me { align-self: flex-end; color: #fff; background: var(--accent); border-bottom-right-radius: 4px; }
.lab-build-msg.ai { align-self: flex-start; color: var(--text); background: var(--surface); border: 1px solid var(--border); border-bottom-left-radius: 4px; }
.lab-build-msg.err { align-self: flex-start; color: var(--text); background: color-mix(in srgb, #ef4444 12%, var(--surface)); border: 1px solid color-mix(in srgb, #ef4444 40%, var(--border)); border-bottom-left-radius: 4px; }
.lab-build-msg .lab-build-act { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 7px; }
.lab-build-msg button { font: 600 0.78rem var(--font-body, inherit); padding: 4px 10px; border-radius: 999px; cursor: pointer; color: var(--text); background: var(--bg-elevated); border: 1px solid var(--border); }
.lab-build-msg button:hover, .lab-build-msg button:focus-visible { border-color: var(--accent-2); outline: none; }
.lab-build-msg.work { display: flex; align-items: center; gap: 9px; color: var(--text-muted); }
.lab-build-dots { display: inline-flex; gap: 4px; }
.lab-build-dots i { width: 6px; height: 6px; border-radius: 50%; background: var(--accent-2); animation: labBuildDot 1s infinite ease-in-out; }
.lab-build-dots i:nth-child(2) { animation-delay: 0.15s; } .lab-build-dots i:nth-child(3) { animation-delay: 0.3s; }
@keyframes labBuildDot { 0%, 80%, 100% { opacity: 0.25; transform: scale(0.8); } 40% { opacity: 1; transform: scale(1); } }
.lab-build-ideas { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 10px; }
.lab-build-ideas button { font: 600 0.78rem var(--font-body, inherit); padding: 5px 11px; border-radius: 999px; cursor: pointer; color: var(--text); background: var(--bg-elevated); border: 1px solid var(--border); }
.lab-build-ideas button:hover, .lab-build-ideas button:focus-visible { border-color: var(--accent-2); outline: none; }
.lab-build-form { display: flex; gap: 8px; align-items: flex-end; }
.lab-build-form textarea { flex: 1 1 auto; min-width: 0; resize: none; height: 44px; max-height: 110px; padding: 10px 12px; border-radius: 12px; font: 0.9rem/1.35 var(--font-body, inherit); color: var(--text); background: var(--bg); border: 1px solid var(--border); }
.lab-build-form textarea:focus { outline: 2px solid var(--accent); outline-offset: 1px; }
.lab-build-form .btn { height: 44px; flex-shrink: 0; }
.lab-build-form .btn[disabled] { opacity: 0.6; cursor: wait; }
.lab-build-hint { margin: 7px 2px 0; font-size: 0.74rem; color: var(--text-muted); }
@keyframes labRunPulse { 0%, 100% { box-shadow: 0 0 0 0 rgba(56, 182, 255, 0); } 50% { box-shadow: 0 0 0 7px rgba(56, 182, 255, 0.45); } }
.lab-run.lab-run-pulse { animation: labRunPulse 1.1s ease-in-out 4; }
@media (max-width: 560px) { .lab-build-sub { display: none; } .lab-build-msg { max-width: 94%; } }
@media (prefers-reduced-motion: reduce) { .lab-run.lab-run-pulse, .lab-build-dots i { animation: none; } .lab-build-thread { scroll-behavior: auto; } }

.lab-build-clear { background: none; border: 0; padding: 0; margin-left: 6px; font: 600 0.74rem Inter, system-ui, sans-serif; color: var(--text-muted); text-decoration: underline; cursor: pointer; }
.lab-build-clear:hover, .lab-build-clear:focus-visible { color: var(--text); outline: none; }
.lab-build-ideas[hidden] { display: none; } /* hidden must win over display: flex */
.lba-note[hidden] { display: none !important; } /* approved students: no empty bar (hidden lost to display:flex) */
