/* Teacher workspace is versioned separately so existing lab-shell caches cannot hide it. */
.teacher-workspace { position: fixed; inset: 0; z-index: 470; display: grid; place-items: center; padding: 18px; background: rgba(24,29,38,.58); backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px); }
.teacher-workspace[hidden] { display: none; }
.tw-card { width: min(980px, 97vw); max-height: min(92dvh, 860px); overflow: auto; border: 1px solid var(--line2); border-radius: 18px; background: #fff; box-shadow: 0 28px 80px rgba(18,24,34,.38); color: var(--ink); }
.tw-head { position: sticky; top: 0; z-index: 2; display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 16px 18px 12px; border-bottom: 1px solid var(--line2); background: rgba(255,255,255,.96); }
.tw-head h2 { margin: 0; font-size: 21px; }
.tw-head p { margin: 3px 0 0; color: var(--sub); font-size: 12px; }
.tw-close { width: 40px; height: 40px; border: 1px solid var(--line2); border-radius: 10px; background: #fff; color: var(--ink); font-size: 23px; cursor: pointer; }
.tw-tabs { display: flex; gap: 7px; padding: 12px 18px 0; overflow-x: auto; }
.tw-tab { min-height: 40px; padding: 0 14px; border: 1px solid var(--line2); border-radius: 10px 10px 0 0; background: #f5f7fa; color: var(--sub); font-weight: 800; cursor: pointer; white-space: nowrap; }
.tw-tab[aria-selected="true"] { border-color: var(--ink); background: var(--ink); color: #fff; }
.tw-body { padding: 16px 18px 22px; }
.tw-view[hidden] { display: none; }
.tw-grid { display: grid; grid-template-columns: minmax(280px, .88fr) minmax(320px, 1.12fr); gap: 16px; align-items: start; }
.tw-section { min-width: 0; padding: 15px; border: 1px solid var(--line2); border-radius: 13px; background: #fbfcfe; }
.tw-section h3 { margin: 0 0 10px; font-size: 16px; }
.tw-boundary { margin: 0 0 13px; padding: 9px 11px; border-left: 4px solid #d39a49; border-radius: 8px; background: #fff8e8; color: #684b1f; font-size: 12px; line-height: 1.5; }
.tw-form { display: grid; gap: 10px; }
.tw-form label { display: grid; gap: 5px; color: #3f4858; font-size: 12px; font-weight: 800; }
.tw-form input, .tw-form select, .tw-form textarea { width: 100%; min-width: 0; min-height: 40px; padding: 8px 10px; border: 1px solid var(--line2); border-radius: 9px; background: #fff; color: var(--ink); font: inherit; }
.tw-form textarea { min-height: 78px; resize: vertical; }
.tw-pair { display: grid; grid-template-columns: 1fr 1fr; gap: 9px; }
.tw-primary, .tw-action, .tw-danger { min-height: 40px; padding: 7px 12px; border: 1px solid var(--line2); border-radius: 9px; background: #fff; color: var(--ink); font: inherit; font-weight: 800; cursor: pointer; }
.tw-primary { border-color: var(--ink); background: var(--ink); color: #fff; }
.tw-danger { color: var(--danger); }
.tw-primary:hover, .tw-action:hover { filter: brightness(.96); border-color: var(--acc); }
.tw-list { display: grid; gap: 9px; }
.tw-empty { padding: 18px 10px; border: 1px dashed var(--line2); border-radius: 10px; color: var(--sub); text-align: center; font-size: 12px; }
.tw-item { padding: 11px; border: 1px solid var(--line2); border-radius: 11px; background: #fff; }
.tw-item-head { display: flex; align-items: start; justify-content: space-between; gap: 10px; }
.tw-item h4 { margin: 0; font-size: 14px; }
.tw-meta { margin-top: 4px; color: var(--sub); font-size: 11px; line-height: 1.45; overflow-wrap: anywhere; }
.tw-chip { display: inline-flex; align-items: center; min-height: 24px; padding: 2px 8px; border-radius: 999px; background: #edf4fb; color: #315f8d; font-size: 10px; font-weight: 850; white-space: nowrap; }
.tw-actions { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 9px; }
.tw-actions button { min-height: 36px; }
.tw-status { margin: 12px 0 0; padding: 9px 10px; border-radius: 9px; background: #edf8f2; color: #275e43; font-size: 12px; font-weight: 750; }
.tw-status[data-state="error"] { background: #fff0f0; color: #8a3030; }
.tw-active { padding: 13px; border: 2px solid #9fb8ca; border-radius: 12px; background: #eef6fb; }
.tw-active h3 { margin: 0 0 5px; }
.tw-code { font: 850 15px/1.2 ui-monospace,SFMono-Regular,Menlo,monospace; letter-spacing: .08em; }
.tw-review textarea { width: 100%; min-height: 66px; margin-top: 8px; padding: 8px 10px; border: 1px solid var(--line2); border-radius: 8px; resize: vertical; font: inherit; }
.tw-file { display: inline-flex; align-items: center; min-height: 40px; padding: 7px 11px; border: 1px dashed var(--silver2); border-radius: 9px; background: #fff; color: var(--ink); font-size: 12px; font-weight: 800; cursor: pointer; }
.tw-file input { position: absolute; width: 1px; height: 1px; opacity: 0; pointer-events: none; }
@media (max-width: 1200px) { #topbar #tbTeacher { width: auto; min-width: max-content; padding: 0 8px; } #topbar #tbTeacher > span { display: inline; } }
@media (max-width: 760px) { .teacher-workspace { padding: 8px; align-items: end; } .tw-card { width: 100%; max-height: calc(100dvh - 16px); border-radius: 16px 16px 10px 10px; } .tw-grid, .tw-pair { grid-template-columns: 1fr; } .tw-head { padding: 13px; } .tw-tabs, .tw-body { padding-left: 13px; padding-right: 13px; } }
@media (pointer: coarse) { .tw-close, .tw-tab, .tw-primary, .tw-action, .tw-danger, .tw-file, .tw-form input, .tw-form select { min-height: 44px; } }
