/* style.css
   VS Code dark theme layout & styles for MongoSandbox
*/

:root {
  --bg:         #000000;
  --bg2:        #0d0d0d;
  --bg3:        #151515;
  --bg4:        #222222;
  --bg5:        #2a2a2a;
  --actbar:     #080808;
  --border:     #222222;
  --border2:    #333333;
  --text:       #cccccc;
  --text2:      #9d9d9d;
  --text3:      #858585;
  --hl:         #094771;
  --hl2:        #2a2d2e;
  --blue:       #007acc;
  --blue2:      #4fc1ff;
  --green:      #2a2a2a;
  --green2:     #cccccc;
  --green3:     #e0e0e0;
  --mongo:      #1a1a1a;
  --orange:     #ce9178;
  --yellow:     #dcdcaa;
  --purple:     #c586c0;
  --red:        #f48771;
  --cyan:       #9cdcfe;
  --statusbar:  #000000;
  --sidebar-w:  240px;
  --act-w:      48px;
  --insp-w:     220px;
  --console-h:  220px;
  --toolbar-h:  0px;
  --tabbar-h:   35px;
  --title-h:    30px;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html, body {
  height: 100%;
  overflow: hidden;
  font-family: 'Segoe UI', system-ui, sans-serif;
  font-size: 13px;
  background: var(--bg);
  color: var(--text);
}

button, input {
  font-family: inherit;
  font-size: inherit;
  color: inherit;
}

a {
  color: var(--blue2);
}

/* Scrollbars */
::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}
::-webkit-scrollbar-track {
  background: transparent;
}
::-webkit-scrollbar-thumb {
  background: #4a4a4a;
  border-radius: 2px;
}
::-webkit-scrollbar-thumb:hover {
  background: #666;
}

/* ═══════════════════════════════════════════════════════════════
   TITLE BAR
═══════════════════════════════════════════════════════════════ */
#titlebar {
  height: var(--title-h);
  background: var(--bg2);
  display: flex;
  align-items: center;
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
  user-select: none;
  position: relative;
}

#win-icon {
  width: 48px;
  display: flex;
  justify-content: center;
  align-items: center;
  font-size: 14px;
}

#win-menu {
  display: flex;
  height: 100%;
  z-index: 500;
}

.wmenu {
  padding: 0 10px;
  font-size: 12px;
  color: #cccccc;
  cursor: pointer;
  display: flex;
  align-items: center;
  position: relative;
}

.wmenu:hover, .wmenu.open {
  background: rgba(255, 255, 255, 0.12);
}

.wmenu-dropdown {
  display: none;
  position: absolute;
  top: 100%;
  left: 0;
  background: #252526;
  border: 1px solid #454545;
  min-width: 170px;
  z-index: 600;
  box-shadow: 2px 4px 12px rgba(0, 0, 0, 0.5);
}

.wmenu.open .wmenu-dropdown {
  display: block;
}

.wmenu-item {
  padding: 6px 16px;
  font-size: 12px;
  color: #cccccc;
  cursor: pointer;
  display: flex;
  justify-content: space-between;
  gap: 20px;
  white-space: nowrap;
}

.wmenu-item:hover {
  background: var(--hl);
  color: #ffffff;
}

.wmenu-sep {
  height: 1px;
  background: #3c3c3c;
  margin: 4px 0;
}

#win-title {
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  font-size: 12px;
  color: #9d9d9d;
  pointer-events: none;
  white-space: nowrap;
}

#win-controls {
  margin-left: auto;
  display: flex;
  height: 100%;
}

.wctrl {
  width: 46px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  cursor: pointer;
  color: #ccc;
}

.wctrl:hover {
  background: rgba(255, 255, 255, 0.1);
}

.wctrl.close:hover {
  background: #e81123;
  color: #fff;
}

#win-controls .tbtn-secondary.active {
  background: #3c3c3c !important;
  color: #fff !important;
  border-color: #555 !important;
}

#win-controls .tbtn:hover {
  background: rgba(255, 255, 255, 0.08) !important;
}

#win-controls .tbtn-run:hover {
  background: #4a9b10 !important;
}

/* ═══════════════════════════════════════════════════════════════
   LAYOUT SHELL
═══════════════════════════════════════════════════════════════ */
#shell {
  flex: 1;
  display: flex;
  overflow: hidden;
}

body {
  display: flex;
  flex-direction: column;
}

/* ═══════════════════════════════════════════════════════════════
   ACTIVITY BAR
═══════════════════════════════════════════════════════════════ */
#actbar {
  width: var(--act-w);
  background: var(--actbar);
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 4px 0;
  gap: 0;
  flex-shrink: 0;
  border-right: 1px solid #252526;
}

.act-btn {
  width: 48px;
  height: 48px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #858585;
  cursor: pointer;
  border: none;
  background: none;
  position: relative;
  border-left: 2px solid transparent;
  transition: color .1s;
}

.act-btn:hover {
  color: #cccccc;
}

.act-btn.active {
  color: #cccccc;
  border-left-color: #cccccc;
}

.act-btn-meeting {
  color: #00ed64;
}

.act-btn-meeting:hover {
  color: #00ff7f;
  background: rgba(0, 237, 100, 0.08);
}

.act-btn-meeting.active {
  color: #00ed64;
  border-left-color: #00ed64;
  box-shadow: inset 0 0 8px rgba(78, 201, 176, 0.25);
}

.act-btn-meeting.active svg {
  filter: drop-shadow(0 0 4px rgba(78, 201, 176, 0.6));
}

.act-btn svg {
  width: 24px;
  height: 24px;
  fill: currentColor;
}

.act-spacer {
  flex: 1;
}

.act-btn[data-tip]:hover::after {
  content: attr(data-tip);
  position: absolute;
  left: 54px;
  top: 50%;
  transform: translateY(-50%);
  background: #252526;
  color: #ccc;
  padding: 5px 10px;
  border-radius: 3px;
  font-size: 11px;
  white-space: nowrap;
  border: 1px solid #454545;
  z-index: 600;
  pointer-events: none;
  box-shadow: 2px 4px 8px rgba(0,0,0,.4);
}

/* ═══════════════════════════════════════════════════════════════
   SIDEBAR
═══════════════════════════════════════════════════════════════ */
#sidebar {
  width: var(--sidebar-w);
  background: var(--bg2);
  display: flex;
  flex-direction: column;
  flex-shrink: 0;
  overflow: hidden;
  border-right: 1px solid var(--border);
}

.sidebar-panel {
  display: none;
  flex-direction: column;
  flex: 1;
  overflow: hidden;
}

.sidebar-panel.active {
  display: flex;
}

.panel-hdr {
  height: 24px;
  padding: 0 12px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: .5px;
  color: #bbbbbb;
  text-transform: uppercase;
  flex-shrink: 0;
  user-select: none;
  background-color: var(--bg2);
}

.panel-hdr-btns {
  display: flex;
  gap: 2px;
}

.phbtn {
  width: 20px;
  height: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: none;
  background: none;
  color: #9d9d9d;
  cursor: pointer;
  border-radius: 3px;
  font-size: 12px;
}

.phbtn:hover {
  background: rgba(255, 255, 255, 0.1);
  color: #fff;
}

.panel-search {
  margin: 6px 8px;
  padding: 4px 8px;
  background: var(--bg4);
  border: 1px solid var(--border2);
  border-radius: 2px;
  color: var(--text);
  font-size: 12px;
  outline: none;
  width: calc(100% - 16px);
}

.panel-search:focus {
  border-color: var(--blue);
}

.panel-body {
  flex: 1;
  overflow-y: auto;
}

/* ── Database Explorer Tree ──────────────────────────── */
.db-root {
  padding: 4px 12px;
  font-size: 12px;
  color: #9cdcfe;
  font-weight: 600;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 5px;
  user-select: none;
}

.db-root:hover {
  background: var(--hl2);
}

.tree-item {
  padding: 4px 12px 4px 28px;
  font-size: 12px;
  color: var(--text);
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 6px;
  position: relative;
  border-left: 2px solid transparent;
  user-select: none;
}

.tree-item:hover {
  background: var(--hl2);
}

.tree-item.active {
  background: var(--hl);
  border-left-color: var(--blue);
}

.tree-badge {
  margin-left: auto;
  font-size: 10px;
  color: var(--text3);
  background: transparent;
  padding: 1px 5px;
  border-radius: 8px;
}

.tree-icon {
  font-size: 13px;
  flex-shrink: 0;
}

/* ── Queries File Tree ────────────────────────────────── */
.file-section {
  display: flex;
  flex-direction: column;
  flex: 1;
  overflow: hidden;
}

.file-section-hdr {
  padding: 4px 12px;
  font-size: 11px;
  font-weight: 600;
  color: #bbbbbb;
  text-transform: uppercase;
  letter-spacing: .5px;
  display: flex;
  align-items: center;
  gap: 6px;
  cursor: pointer;
  user-select: none;
}

.file-section-hdr:hover {
  background: var(--hl2);
}

.file-section-hdr .arrow {
  font-size: 9px;
  color: var(--text3);
  transition: transform .15s;
  width: 12px;
  text-align: center;
}

.file-section.collapsed .file-section-hdr .arrow {
  transform: rotate(-90deg);
}

.file-list-container {
  display: flex;
  flex-direction: column;
  flex: 1;
  overflow-y: auto;
}

.file-section.collapsed .file-list-container {
  display: none;
}

/* Workspace connection row and empty state. Keep these as real explorer
   surfaces instead of letting plain text/button content collapse together in
   the narrow sidebar. */
.workspace-folder-status {
  min-height: 30px;
  padding: 4px 12px;
  display: flex;
  align-items: center;
  gap: 7px;
  box-sizing: border-box;
  border-bottom: 1px solid rgba(255,255,255,.06);
  color: var(--text2);
  background: rgba(255,255,255,.018);
  font-size: 11px;
  line-height: 16px;
  white-space: nowrap;
}
.workspace-folder-status.connected {
  color: var(--text);
  background: rgba(255,255,255,.028);
}
.workspace-folder-status-icon {
  width: 14px;
  height: 14px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 14px;
  color: var(--text3);
}
.workspace-folder-status.connected .workspace-folder-status-icon { color: #dcb67a; }
.workspace-folder-status-icon svg { width: 14px; height: 14px; display: block; }
.workspace-folder-status-text {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
}
.workspace-empty-state {
  margin: 12px 10px;
  padding: 20px 12px 18px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 7px;
  border: 1px solid var(--border);
  border-radius: 5px;
  background: rgba(255,255,255,.018);
  color: var(--text3);
  font-size: 11px;
  line-height: 1.45;
  text-align: center;
}
.workspace-empty-state strong { color: var(--text2); font-size: 12px; font-weight: 600; }
.workspace-empty-state > span:not(.workspace-empty-icon) { max-width: 190px; }
.workspace-empty-icon {
  width: 30px;
  height: 30px;
  display: grid;
  place-items: center;
  color: var(--text3);
  border: 1px solid var(--border2);
  border-radius: 6px;
  background: var(--bg3);
}
.workspace-empty-icon svg { width: 17px; height: 17px; }
.workspace-empty-state button {
  width: 100%;
  min-height: 28px;
  margin-top: 5px;
  padding: 5px 9px;
  border: 1px solid var(--border2);
  border-radius: 4px;
  background: var(--bg3);
  color: var(--text2);
  cursor: pointer;
  font: 11px 'Segoe UI', sans-serif;
}
.workspace-empty-state button:hover { background: var(--hl2); color: var(--text); border-color: var(--blue); }

.file-item {
  padding: 4px 12px 4px 28px;
  font-size: 12px;
  color: var(--text);
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 6px;
  border-left: 2px solid transparent;
  user-select: none;
}

.file-item:hover {
  background: var(--hl2);
}

.file-item.active {
  background: var(--hl);
  border-left-color: var(--blue2);
  color: #fff;
}

.file-item:focus-visible,
.phbtn:focus-visible,
.tab:focus-visible,
.tab-close:focus-visible,
.tab-add:focus-visible {
  outline: 1px solid var(--blue);
  outline-offset: -1px;
}

.file-icon {
  color: #519aba;
  font-size: 12px;
  flex-shrink: 0;
}

/* Local VS Code-style fold controls in the editor gutter. */
.codexa-fold-gutter {
  width: 14px;
}

.codexa-fold-marker {
  display: inline-block;
  width: 14px;
  color: #858585;
  cursor: pointer;
  font-size: 12px;
  line-height: 1;
  text-align: center;
  user-select: none;
}

.codexa-fold-marker:hover {
  color: #d4d4d4;
}

.codexa-fold-placeholder {
  width: auto;
  margin: 0 2px;
  color: #858585;
  cursor: default;
}

/* ── Accordion bars for files outline/timeline ────────── */
.accordion-bar {
  height: 24px;
  background-color: var(--bg2);
  border-top: 1px solid var(--border);
  display: flex;
  align-items: center;
  padding: 0 10px;
  font-size: 11px;
  font-weight: bold;
  color: var(--text3);
  cursor: pointer;
  user-select: none;
}

.accordion-bar:hover {
  color: var(--text);
}

/* ── Snippets Tree ──────────────────────────────────── */
.snip-cat {
  padding: 0;
}

.snip-cat-hdr {
  padding: 4px 10px;
  font-size: 11px;
  font-weight: 600;
  color: #bbbbbb;
  display: flex;
  align-items: center;
  gap: 5px;
  cursor: pointer;
  user-select: none;
}

.snip-cat-hdr:hover {
  background: var(--hl2);
}

.snip-cat-hdr .arrow {
  transition: transform .15s;
  display: inline-block;
  font-size: 9px;
  color: #858585;
}

.snip-cat.collapsed .snip-cat-hdr .arrow {
  transform: rotate(-90deg);
}

.snip-cat-icon {
  font-size: 13px;
}

.snip-items {
  display: block;
}

.snip-cat.collapsed .snip-items {
  display: none;
}

.snip-item {
  padding: 4px 10px 4px 30px;
  font-size: 12px;
  color: #cccccc;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 6px;
  user-select: none;
}

.snip-item:hover {
  background: var(--hl2);
}

.snip-item-icon {
  color: #9d9d9d;
  font-size: 11px;
}

/* ── History Panel ──────────────────────────────────── */
.history-item {
  padding: 6px 12px;
  font-size: 12px;
  color: var(--text);
  cursor: pointer;
  border-bottom: 1px solid rgba(255, 255, 255, 0.04);
  display: flex;
  flex-direction: column;
  gap: 3px;
  user-select: none;
}

.history-item:hover {
  background: var(--hl2);
}

.history-item-top {
  display: flex;
  align-items: center;
  gap: 6px;
}

.history-status-icon {
  font-size: 12px;
}

.history-query-short {
  font-family: 'JetBrains Mono', Consolas, monospace;
  font-size: 11px;
  color: #ffd343;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  flex: 1;
}

.history-fav-star {
  color: #ff9800;
  font-size: 12px;
}

.history-item-meta {
  display: flex;
  justify-content: space-between;
  font-size: 10px;
  color: var(--text3);
}

/* Resize handle */
#resizer {
  width: 4px;
  background: transparent;
  cursor: col-resize;
  flex-shrink: 0;
  transition: background .15s;
  z-index: 10;
}

#resizer:hover, #resizer.dragging {
  background: var(--blue);
}

/* ═══════════════════════════════════════════════════════════════
   MAIN WORKSPACE
═══════════════════════════════════════════════════════════════ */
#workspace {
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  min-width: 0;
}

/* ── Toolbar ────────────────────────────────────────── */
#toolbar {
  height: var(--toolbar-h);
  background: var(--bg3);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  padding: 0 8px;
  gap: 4px;
  flex-shrink: 0;
}

.tbtn {
  padding: 4px 12px;
  font-size: 12px;
  border-radius: 4px;
  cursor: pointer;
  border: 1px solid rgba(255,255,255,0.1);
  font-family: inherit;
  display: flex;
  align-items: center;
  gap: 5px;
  transition: all .1s;
  white-space: nowrap;
}

.tbtn-run {
  background: #3a7d0a;
  color: #fff;
  font-weight: 600;
  border-color: transparent;
}

.tbtn-run:hover {
  background: #4a9b10;
}

.tbtn-run.running {
  background: #a32929;
}

.tbtn-run.running:hover {
  background: #c23b3b;
}

.tbtn-secondary {
  background: var(--bg4);
  color: var(--text);
}

.tbtn-secondary:hover {
  background: var(--hl2);
}

.tb-sep {
  width: 1px;
  height: 16px;
  background: var(--border2);
  margin: 0 4px;
}

#tb-right {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 8px;
}

#db-badge {
  padding: 3px 10px;
  font-size: 11px;
  border: 1px solid var(--border2);
  border-radius: 2px;
  color: var(--green2);
  background: var(--bg);
  display: flex;
  align-items: center;
  gap: 5px;
  font-weight: 600;
}

#db-badge::before {
  content: '●';
  color: var(--green2);
  font-size: 9px;
}

#db-badge.disconnected {
  color: #ff9800;
}

#db-badge.disconnected::before {
  color: #ff9800;
}

/* ── Tab bar ─────────────────────────────────────────── */
#tabbar {
  height: var(--tabbar-h);
  background: var(--bg2);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: stretch;
  flex-shrink: 0;
  overflow-x: auto;
  scrollbar-width: thin;
  scrollbar-color: #4a4a4a transparent;
}
#tabbar::-webkit-scrollbar { height: 3px; }
#tabbar::-webkit-scrollbar-track { background: transparent; }
#tabbar::-webkit-scrollbar-thumb { background: #4a4a4a; border-radius: 6px; }

/* ── Codexa AI editor assistant ─────────────────────────── */
#editor-inspector { position: relative; display: flex; flex: 1; min-width: 0; min-height: 0; overflow: hidden; }
#workspace-ai-launch {
  position: absolute; top: 9px; right: 14px; z-index: 8;
  display: inline-flex; align-items: center; gap: 6px; height: 28px;
  padding: 0 10px; border: 1px solid rgba(77,170,242,.38); border-radius: 5px;
  background: linear-gradient(135deg, rgba(0,120,212,.22), rgba(77,170,242,.08));
  color: #b9ddff; font: 600 11px 'Segoe UI', sans-serif; cursor: pointer;
  box-shadow: 0 5px 18px rgba(0,0,0,.2); transition: .16s ease;
}
#workspace-ai-launch:hover { border-color: #4daaf2; background: rgba(0,120,212,.3); color: #fff; transform: translateY(-1px); }
#workspace-ai-launch svg { width: 15px; height: 15px; fill: #6fc3ff; }
#editor-inspector.workspace-ai-open #workspace-ai-launch { display:none; }
#workspace-ai-panel {
  position: relative; z-index: 4; flex: 0 0 360px; width: 360px; min-width: 300px;
  display: flex; flex-direction: column; gap: 12px; padding: 14px;
  border: 0; border-left: 1px solid var(--border); border-radius: 0; background: var(--bg2);
  color: var(--text); box-shadow: -10px 0 24px rgba(0,0,0,.16);
}
#workspace-ai-panel[hidden] { display: none; }
.workspace-ai-header, .workspace-ai-brand, .workspace-ai-context, .workspace-ai-autofill { display:flex; align-items:center; }
.workspace-ai-header { justify-content:space-between; }
.workspace-ai-brand { gap:9px; }
.workspace-ai-mark { display:grid; place-items:center; width:27px; height:27px; border-radius:7px; background:linear-gradient(135deg,#0078d4,#4daaf2); color:#07121d; }
.workspace-ai-mark svg { width:16px; height:16px; fill:currentColor; }
.workspace-ai-brand strong { display:block; font-size:12px; letter-spacing:.01em; color:var(--text); }
.workspace-ai-brand small { display:block; margin-top:2px; color:var(--text3); font-size:10px; }
.workspace-ai-close { border:0; background:transparent; color:#7790a4; font-size:20px; line-height:1; cursor:pointer; }
.workspace-ai-close:hover { color:#fff; }
.workspace-ai-context { gap:7px; padding:7px 9px; border:1px solid var(--border); border-radius:4px; color:var(--text3); font:10px 'JetBrains Mono',monospace; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.workspace-ai-live-dot { width:6px; height:6px; flex:none; border-radius:50%; background:#55c2ff; box-shadow:0 0 8px #55c2ff; }
.workspace-ai-presets { display:flex; gap:5px; flex-wrap:wrap; }
.workspace-ai-presets button { padding:5px 8px; border:1px solid var(--border2); border-radius:4px; background:var(--bg3); color:var(--text2); font-size:10px; cursor:pointer; }
.workspace-ai-presets button:hover { border-color:#4daaf2; color:#e9f5ff; }
#workspace-ai-request { width:100%; resize:vertical; min-height:68px; padding:9px; border:1px solid var(--border2); border-radius:4px; outline:0; background:var(--bg); color:var(--text); font:11px/1.5 'JetBrains Mono',monospace; }
#workspace-ai-request:focus { border-color:#4daaf2; box-shadow:0 0 0 2px rgba(77,170,242,.12); }
.workspace-ai-autofill { justify-content:space-between; gap:10px; padding:9px; border:1px solid var(--border); border-radius:4px; cursor:pointer; }
.workspace-ai-autofill input { position:absolute; opacity:0; }
.workspace-ai-autofill span:nth-child(2) { flex:1; }
.workspace-ai-autofill strong, .workspace-ai-autofill small { display:block; }
.workspace-ai-autofill strong { color:var(--text2); font-size:11px; }
.workspace-ai-autofill small { margin-top:3px; color:var(--text3); font-size:9px; line-height:1.3; }
.workspace-ai-toggle { width:29px; height:16px; flex:none; border-radius:10px; background:#2c3b48; position:relative; }
.workspace-ai-toggle::after { content:''; position:absolute; top:3px; left:3px; width:10px; height:10px; border-radius:50%; background:#7b91a1; transition:.16s; }
.workspace-ai-autofill input:checked ~ .workspace-ai-toggle { background:#075d9d; }
.workspace-ai-autofill input:checked ~ .workspace-ai-toggle::after { left:16px; background:#9bd6ff; }
.workspace-ai-send { display:flex; align-items:center; justify-content:center; gap:7px; height:32px; border:1px solid #2387d1; border-radius:5px; background:#0878c9; color:#fff; font:600 11px 'Segoe UI',sans-serif; cursor:pointer; }
.workspace-ai-send:hover:not(:disabled) { background:#168ad9; }
.workspace-ai-send:disabled { opacity:.65; cursor:wait; }
.workspace-ai-send svg { width:14px; height:14px; fill:currentColor; }
.workspace-ai-result { flex:1; min-height:0; max-height:none; overflow:auto; border-top:1px solid var(--border); padding-top:11px; font-size:11px; }
.workspace-ai-empty, .workspace-ai-thinking { color:#71879a; line-height:1.55; text-align:center; padding:13px 5px; }
.workspace-ai-thinking { display:flex; justify-content:center; gap:4px; align-items:center; }
.workspace-ai-thinking span { width:5px; height:5px; border-radius:50%; background:#4daaf2; animation:codexa-ai-pulse 1s infinite; }
.workspace-ai-thinking span:nth-child(2) { animation-delay:.15s; }.workspace-ai-thinking span:nth-child(3) { animation-delay:.3s; }
@keyframes codexa-ai-pulse { 0%,100%{opacity:.3;transform:translateY(0)}50%{opacity:1;transform:translateY(-3px)} }
.workspace-ai-success { display:flex; gap:8px; color:#cfe9d2; }.workspace-ai-result-icon { color:#6fd18b; font-size:16px; }.workspace-ai-success strong { color:#dceeff; }.workspace-ai-success p { margin:4px 0 0; color:#9bb0c0; line-height:1.45; }
.workspace-ai-notes { margin-top:9px; padding:8px; border-left:2px solid #3e91c9; color:#a6bdcd; line-height:1.5; background:#121a21; }
.workspace-ai-correction { display:flex; align-items:center; justify-content:space-between; gap:8px; margin-top:10px; padding-top:9px; border-top:1px solid #293744; color:#9bc9e7; font-size:10px; }.workspace-ai-correction button { padding:5px 8px; border:1px solid #3e91c9; border-radius:4px; background:#153b59; color:#d8efff; cursor:pointer; font-size:10px; }
.workspace-ai-applied { margin-bottom:8px; padding:6px 8px; border-radius:4px; background:rgba(71,162,72,.14); color:#8ee09c; font-size:10px; }.workspace-ai-error { padding:9px; border:1px solid #673b42; border-radius:5px; background:#24171b; }.workspace-ai-error strong { color:#ff9a9a; }.workspace-ai-error p { margin:5px 0 0; color:#d3a5a5; line-height:1.4; }
@media (max-width: 900px) { #workspace-ai-panel { flex-basis:320px; width:320px; min-width:280px; } }
@media (max-width: 700px) { #workspace-ai-panel { position:absolute; inset:0; width:auto; min-width:0; } #workspace-ai-launch span { display:none; } }

/* VS Code-style Codexa AI dock */
#workspace-ai-launch-toolbar {
  display: inline-grid;
  place-items: center;
  width: 26px;
  height: 22px;
  padding: 0;
  border: 1px solid #3c3c3c;
  border-radius: 3px;
  background: #252526;
  color: #c5c5c5;
  cursor: pointer;
}
#workspace-ai-launch-toolbar:hover,
#workspace-ai-launch-toolbar[aria-expanded="true"] {
  border-color: #3794ff;
  background: #2a2d2e;
  color: #fff;
}
#workspace-ai-launch-toolbar svg { width: 14px; height: 14px; fill: #75beff; }
#workspace-ai-legacy-launch { display: none !important; }
#workspace-ai-panel {
  flex-basis: 354px;
  width: 354px;
  min-width: 320px;
  gap: 10px;
  padding: 0;
  border-left: 1px solid #303031;
  background: #181818;
  box-shadow: -10px 0 22px rgba(0,0,0,.12);
}
.workspace-ai-header {
  min-height: 39px;
  padding: 0 10px 0 12px;
  border-bottom: 1px solid #303031;
  background: #1f1f1f;
}
.workspace-ai-brand { gap: 7px; min-width: 0; }
.workspace-ai-mark {
  width: 20px;
  height: 20px;
  border-radius: 4px;
  background: #3794ff;
  color: #101010;
}
.workspace-ai-mark svg { width: 13px; height: 13px; }
.workspace-ai-brand strong { font-size: 12px; color: #e7e7e7; }
.workspace-ai-brand small { margin: 0; font-size: 10px; color: #858585; }
.workspace-ai-title-divider { color: #555; }
.workspace-ai-actions { display: flex; align-items: center; gap: 2px; }
.workspace-ai-action,
.workspace-ai-close {
  width: 24px;
  height: 24px;
  padding: 0;
  border: 0;
  border-radius: 3px;
  background: transparent;
  color: #bdbdbd;
  font-size: 18px;
  line-height: 1;
  cursor: pointer;
}
.workspace-ai-action:hover,
.workspace-ai-close:hover { background: #2a2d2e; color: #fff; }
.workspace-ai-context { margin: 10px 10px 0; padding: 6px 8px; border-color: #303031; border-radius: 3px; background: #1f1f1f; }
.workspace-ai-presets { padding: 0 10px; }
.workspace-ai-presets button {
  padding: 4px 9px;
  border-color: #454545;
  border-radius: 3px;
  background: #252526;
  color: #c8c8c8;
}
.workspace-ai-presets button:hover { border-color: #3794ff; color: #fff; background: #2a2d2e; }
#workspace-ai-request {
  width: auto;
  margin: 0 10px;
  min-height: 76px;
  padding: 8px;
  border-color: #454545;
  border-radius: 3px;
  background: #1f1f1f;
  color: #d4d4d4;
  font-family: 'Segoe UI', sans-serif;
}
#workspace-ai-request:focus { border-color: #3794ff; box-shadow: 0 0 0 1px #3794ff; }
.workspace-ai-autofill { margin: 0 10px; padding: 8px; border-color: #303031; border-radius: 3px; background: #1f1f1f; }
.workspace-ai-send {
  margin: 0 10px;
  height: 30px;
  border: 1px solid #3794ff;
  border-radius: 3px;
  background: #0e639c;
}
.workspace-ai-send:hover:not(:disabled) { background: #1177bb; }
.workspace-ai-result {
  margin-top: 2px;
  padding: 10px;
  border-top-color: #303031;
  background: #181818;
}
.workspace-ai-empty, .workspace-ai-thinking { color: #858585; }
.workspace-ai-notes { background: #1f1f1f; border-left-color: #3794ff; color: #c8c8c8; }
.workspace-ai-success strong { color: #e7e7e7; }
.workspace-ai-success p { color: #b8b8b8; }
.workspace-ai-correction { border-top-color: #303031; color: #75beff; }
.workspace-ai-correction button { border-color: #3794ff; background: #252526; color: #d7ebff; }
.workspace-ai-error { border-color: #6b3a3a; background: #2a1f1f; }

/* VS Code-style resize handle and change preview */
#workspace-ai-resizer {
  display: block;
  flex: 0 0 4px;
  width: 4px;
  border-left: 1px solid transparent;
  border-right: 1px solid transparent;
  background: #252526;
  cursor: col-resize;
  z-index: 5;
}
#workspace-ai-resizer[hidden] { display: none; }
#workspace-ai-resizer:hover,
body.workspace-ai-resizing #workspace-ai-resizer { background: #3794ff; }
body.workspace-ai-resizing,
body.workspace-ai-resizing * { cursor: col-resize !important; user-select: none !important; }
.workspace-ai-diff {
  margin-top: 10px;
  border: 1px solid #303031;
  border-radius: 3px;
  overflow: hidden;
  background: #1e1e1e;
}
.workspace-ai-diff summary {
  display: flex;
  align-items: center;
  padding: 7px 9px;
  color: #d4d4d4;
  font-size: 11px;
  cursor: pointer;
  list-style: none;
}
.workspace-ai-diff summary::-webkit-details-marker { display: none; }
.workspace-ai-diff summary::before { content: '›'; margin-right: 7px; color: #858585; }
.workspace-ai-diff[open] summary::before { content: '⌄'; }
.workspace-ai-diff summary small { margin-left: auto; color: #858585; font-size: 10px; }
.workspace-ai-diff-code {
  max-height: 300px;
  overflow: auto;
  border-top: 1px solid #303031;
  font: 10px/1.55 'JetBrains Mono', Consolas, monospace;
}
.workspace-ai-diff-row { display: flex; min-height: 17px; color: #bdbdbd; white-space: pre; }
.workspace-ai-diff-row code { flex: 1; padding: 0 8px; overflow: hidden; }
.workspace-ai-diff-gutter { width: 18px; flex: none; text-align: center; color: #858585; }
.workspace-ai-diff-row.is-added { background: rgba(46,160,67,.22); color: #b7e3bd; }
.workspace-ai-diff-row.is-added .workspace-ai-diff-gutter { color: #6fce7b; }
.workspace-ai-diff-row.is-removed { background: rgba(248,81,73,.20); color: #f2b4b0; }
.workspace-ai-diff-row.is-removed .workspace-ai-diff-gutter { color: #ff8c87; }
.workspace-ai-diff-summary { padding: 10px; color: #a8a8a8; line-height: 1.5; font: 10px/1.5 'Segoe UI', sans-serif; }

/* VS Code chat composition: transcript scrolls, composer stays docked at the bottom. */
#workspace-ai-panel { gap: 0; background: #181818; }
.workspace-ai-context { flex: none; }
.workspace-ai-result {
  order: 2;
  margin: 10px 0 0;
  padding: 12px;
  min-height: 0;
  border-top: 1px solid #303030;
}
.workspace-ai-composer {
  order: 3;
  flex: none;
  padding: 10px;
  border-top: 1px solid #303030;
  background: #1e1e1e;
}
.workspace-ai-presets { padding: 0 0 8px; }
.workspace-ai-input-shell { position: relative; }
#workspace-ai-request {
  width: 100%;
  min-height: 76px;
  max-height: 180px;
  margin: 0;
  padding: 10px 42px 30px 10px;
  box-sizing: border-box;
  resize: vertical;
  border: 1px solid #454545;
  border-radius: 4px;
  background: #181818;
  color: #d4d4d4;
}
.workspace-ai-send {
  position: absolute;
  right: 7px;
  bottom: 7px;
  width: 29px;
  height: 25px;
  margin: 0;
  padding: 0;
  border: 1px solid #505050;
  border-radius: 3px;
  background: #2b2b2b;
  color: #d4d4d4;
}
.workspace-ai-send:hover:not(:disabled) { background: #3a3a3a; border-color: #707070; }
.workspace-ai-send span { display: none; }
.workspace-ai-send svg { width: 13px; height: 13px; fill: currentColor; }
.workspace-ai-autofill { margin: 8px 0 0; padding: 7px 8px; background: #181818; }
.workspace-ai-toggle { background: #4a4a4a; }
.workspace-ai-autofill input:checked ~ .workspace-ai-toggle { background: #707070; }
.workspace-ai-autofill input:checked ~ .workspace-ai-toggle::after { background: #ededed; }
.workspace-ai-live-dot { background: #999; box-shadow: 0 0 7px #999; }
.workspace-ai-thinking { color: #a0a0a0; }
.workspace-ai-thinking span { background: #a0a0a0; }
.workspace-ai-correction button { border-color: #666; background: #2b2b2b; color: #e0e0e0; }
.workspace-ai-user-message {
  align-self: flex-end;
  max-width: 92%;
  margin: 0 0 14px auto;
  padding: 8px 10px;
  border: 1px solid #353535;
  border-radius: 4px;
  background: #252525;
  color: #d4d4d4;
  line-height: 1.45;
}
.workspace-ai-message { padding-bottom: 12px; border-bottom: 1px solid #2a2a2a; }
.workspace-ai-editor-suggestion {
  position: absolute;
  right: 12px;
  bottom: 12px;
  z-index: 10;
  display: flex;
  align-items: center;
  gap: 8px;
  max-width: min(620px, calc(100% - 24px));
  padding: 7px 8px;
  border: 1px solid #454545;
  border-radius: 4px;
  background: #252525;
  color: #cfcfcf;
  box-shadow: 0 8px 20px rgba(0,0,0,.35);
  font: 11px 'Segoe UI', sans-serif;
}
.workspace-ai-editor-suggestion[hidden] { display: none; }
.workspace-ai-editor-suggestion-icon { color: #bdbdbd; }
.workspace-ai-editor-suggestion-text { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.workspace-ai-editor-suggestion button {
  flex: none;
  padding: 4px 9px;
  border: 1px solid #5a5a5a;
  border-radius: 3px;
  background: #333;
  color: #f0f0f0;
  cursor: pointer;
}
.workspace-ai-editor-suggestion button:hover { background: #444; }
#cm-wrap { position: relative; }

.tab {
  min-width: 120px;
  max-width: 220px;
  padding: 0 8px;
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  background: var(--bg3);
  color: var(--text2);
  border-right: 1px solid var(--border);
  cursor: pointer;
  white-space: nowrap;
  flex-shrink: 0;
  border-bottom: 1px solid transparent;
  transition: background-color .12s ease, color .12s ease;
}

.tab:hover {
  background: #2a2d2e;
  color: var(--text);
}

.tab.active {
  background: var(--bg);
  color: var(--text);
  border-bottom: 1px solid var(--bg);
  box-shadow: inset 0 2px 0 var(--blue);
}

.tab-label {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.tab-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--orange);
  flex-shrink: 0;
  display: none;
}

.tab.dirty .tab-dot {
  display: inline-block !important;
}

.tab-close {
  margin-left: auto;
  color: #666;
  font-size: 14px;
  border: none;
  background: none;
  cursor: pointer;
  padding: 0 2px;
  border-radius: 2px;
  line-height: 1;
  display: flex;
  align-items: center;
  flex: 0 0 18px;
  visibility: visible;
  opacity: .62;
  transition: opacity .12s ease, background-color .12s ease, color .12s ease;
}

.tab:hover .tab-close,
.tab.active .tab-close,
.tab-close:focus-visible {
  opacity: 1;
}

.tab-close:hover {
  background: rgba(255,255,255,0.15);
  color: #fff;
}

.tab-add {
  width: 35px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text3);
  cursor: pointer;
  font-size: 18px;
  border: none;
  background: none;
  flex-shrink: 0;
}

.tab-add:hover {
  color: var(--text);
}

/* ── Editor + Inspector wrapper ──────────────────────── */
#editor-inspector {
  flex: 1;
  display: flex;
  overflow: hidden;
  min-height: 0;
}

#cm-wrap {
  flex: 1;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.CodeMirror {
  height: 100% !important;
  font-family: 'JetBrains Mono', Consolas, monospace;
  font-size: 13px;
  line-height: 1.6;
}

.CodeMirror-scroll {
  padding-top: 2px;
  padding-bottom: 18px;
}

.CodeMirror-vscrollbar,
.CodeMirror-hscrollbar,
#sidebar .file-list-container,
#sidebar .panel-body {
  scrollbar-width: thin;
  scrollbar-color: #4a4a4a transparent;
}

.CodeMirror ::selection {
  background: #264f78;
}

/* SQL files use a notebook-style cell runner instead of the shared console. */
#sql-notebook { display:none; flex:1; min-height:0; overflow:auto; background:var(--bg); padding:18px 8px 36px; }
#ide-panel.sql-notebook-mode #sql-notebook { display:block; }
#ide-panel.sql-notebook-mode #cm-wrap > .CodeMirror { display:none; }
#ide-panel.sql-notebook-mode #console,
#ide-panel.sql-notebook-mode #console-resizer,
#ide-panel.sql-notebook-mode #inspector { display:none !important; }
.sql-notebook-header { display:flex; align-items:center; gap:8px; width:100%; margin:0 0 14px; color:var(--text2); font-size:12px; }
.sql-notebook-header strong { color:var(--text); font-size:13px; }
.sql-notebook-header span { color:var(--text3); }
.sql-notebook-action { margin-left:auto; padding:5px 9px; border:1px solid var(--border2); border-radius:4px; background:var(--bg3); color:var(--text2); cursor:pointer; font-size:11px; }
.sql-notebook-action:hover { background:var(--hl2); color:var(--text); }
.sql-notebook-cell { width:100%; margin:0 0 7px; border:1px solid var(--border); border-left:3px solid #3a7d0a; border-radius:5px; background:var(--bg2); overflow:hidden; }
.sql-notebook-cell-header { display:flex; align-items:center; gap:8px; height:30px; padding:0 9px; border-bottom:1px solid var(--border); color:var(--text3); font-size:11px; }
.sql-notebook-cell-header strong { color:var(--text2); }
.sql-notebook-icon { width:27px; height:24px; display:inline-grid; place-items:center; margin-left:3px; padding:3px; border:1px solid transparent; border-radius:3px; background:transparent; color:var(--text3); cursor:pointer; }
.sql-notebook-icon:first-of-type { margin-left:auto; }
.sql-notebook-icon svg { width:15px; height:15px; }
.sql-notebook-icon:hover { border-color:var(--border2); background:var(--hl2); color:var(--text); }
.sql-notebook-delete:hover { color:#f48771; }
.sql-cell-input { display:block; width:100%; min-height:30px; padding:0; border:0; outline:0; resize:none; box-sizing:border-box; background:#1e1e1e; color:#d4d4d4; font:13px/1.55 'JetBrains Mono',Consolas,monospace; }
.sql-notebook-cell .CodeMirror { min-height:30px; height:30px; padding:0; font-size:13px; line-height:1.55; background:#1e1e1e; }
.sql-notebook-cell .CodeMirror-gutters { background:#1e1e1e; border-right:1px solid #303030; }
.sql-notebook-cell .CodeMirror-linenumber { color:#666; }
.sql-cell-output { display:none; border-top:1px solid var(--border); padding:10px 13px; background:#181818; color:var(--text2); font:12px/1.55 'JetBrains Mono',Consolas,monospace; white-space:pre-wrap; overflow:auto; }
.sql-cell-output.has-result { display:block; }
.sql-cell-output.error { color:#f48771; }
.sql-result-table-wrap { width:100%; overflow:auto; color:var(--text2); font:12px/1.45 'JetBrains Mono','Consolas',monospace; }
.sql-result-table { width:100%; min-width:max-content; border-collapse:separate; border-spacing:0; background:#111512; }
.sql-result-table th, .sql-result-table td { padding:7px 10px; border-right:1px solid #293329; border-bottom:1px solid #293329; text-align:left; white-space:nowrap; }
.sql-result-table th { position:sticky; top:0; z-index:1; color:#d8e8d4; background:#1b241d; font:600 11px/1.3 'Segoe UI',sans-serif; letter-spacing:.02em; }
.sql-result-table th:first-child, .sql-result-table td:first-child { border-left:1px solid #293329; }
.sql-result-table tbody tr:nth-child(even) td { background:rgba(255,255,255,.018); }
.sql-result-table tbody tr:hover td { background:rgba(168,207,120,.07); }
.sql-result-table td { color:#cbd5ca; }
.sql-result-table td:empty, .sql-result-table td.sql-result-null { color:#758174; font-style:italic; }
.sql-result-no-rows { color:var(--text3) !important; text-align:center !important; padding:14px !important; }
.sql-result-meta { padding:7px 2px 1px; color:var(--text3); font:10px/1.4 'Segoe UI',sans-serif; }
.sql-result-empty { padding:10px 2px; color:var(--text3); font:11px/1.5 'JetBrains Mono',monospace; }
.sql-notebook-result { padding:2px 0; }
.sql-notebook-insert { height:18px; display:flex; align-items:center; justify-content:center; opacity:0; transition:opacity .12s ease; }
.sql-notebook-insert:hover, .sql-notebook-cell:hover + .sql-notebook-insert { opacity:1; }
.sql-notebook-insert button { padding:2px 10px; border:1px solid var(--border2); border-radius:12px; background:var(--bg3); color:var(--text3); cursor:pointer; font-size:10px; }
.sql-notebook-insert button:hover { color:var(--text); border-color:var(--blue); background:var(--hl2); }

/* ── Inspector pane ──────────────────────────────────── */
#inspector {
  width: var(--insp-w);
  background: var(--bg2);
  border-left: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  flex-shrink: 0;
}

.insp-toolbar {
  height: 35px;
  background: var(--bg3);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  padding: 0 12px;
  gap: 6px;
  flex-shrink: 0;
}

.insp-tab {
  font-size: 11px;
  color: var(--text3);
  cursor: pointer;
  padding: 4px 8px;
  border: 1px solid transparent;
  border-radius: 3px;
}

.insp-tab:hover {
  color: var(--text);
}

.insp-tab.active {
  color: var(--text);
  background: var(--bg4);
  border-color: rgba(255,255,255,0.05);
}

.insp-title {
  font-size: 11px;
  font-weight: 600;
  color: #bbbbbb;
  text-transform: uppercase;
  letter-spacing: .5px;
}

.insp-body {
  flex: 1;
  overflow-y: auto;
  padding: 8px;
}

.insp-coll-name {
  font-size: 13px;
  font-weight: 600;
  color: var(--cyan);
  margin-bottom: 2px;
}

.insp-coll-sub {
  font-size: 11px;
  color: var(--text3);
  margin-bottom: 10px;
}

.insp-section {
  font-size: 10px;
  font-weight: 700;
  color: #666;
  text-transform: uppercase;
  letter-spacing: .5px;
  margin: 14px 0 6px;
}

.insp-row {
  display: flex;
  justify-content: space-between;
  padding: 4px 0;
  border-bottom: 1px solid rgba(255,255,255,0.03);
}

.insp-field {
  font-size: 11px;
  color: var(--cyan);
  font-family: 'JetBrains Mono', monospace;
}

.insp-type {
  font-size: 10px;
  color: var(--green2);
  font-family: 'JetBrains Mono', monospace;
}

.insp-empty {
  color: var(--text3);
  font-size: 12px;
  padding: 24px 8px;
  line-height: 1.6;
  text-align: center;
}

/* ── Console ─────────────────────────────────────────── */
#console-resizer:hover, #console-resizer.dragging {
  background: var(--blue) !important;
}

#console {
  height: var(--console-h);
  background: var(--bg);
  border-top: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  flex-shrink: 0;
}

#console-tabs {
  height: 28px;
  background: var(--bg2);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: stretch;
  flex-shrink: 0;
}

.ctab {
  padding: 0 16px;
  font-size: 12px;
  color: var(--text2);
  cursor: pointer;
  border-right: 1px solid var(--border);
  display: flex;
  align-items: center;
  gap: 5px;
  border-bottom: 2px solid transparent;
  user-select: none;
}

.ctab.active {
  color: var(--text);
  border-bottom-color: var(--blue);
  background-color: var(--bg);
}

.ctab:hover {
  color: var(--text);
  background: var(--hl2);
}

.console-status {
  margin-left: 12px;
  font-size: 11px;
  color: var(--text3);
  display: flex;
  align-items: center;
  gap: 8px;
}

.con-badge {
  font-size: 11px;
  padding: 2px 8px;
  background: transparent;
  color: var(--text2);
  border: 1px solid transparent;
  border-radius: 3px;
  cursor: pointer;
  user-select: none;
}

.con-badge:hover {
  color: var(--text);
  background: var(--hl2);
}

.con-badge.active-view {
  background: var(--hl);
  color: #fff;
  border-color: var(--blue);
}

#console-ctrl {
  margin-left: auto;
  padding-right: 8px;
  display: flex;
  align-items: center;
  gap: 4px;
}

.console-btn {
  padding: 2px 8px;
  font-size: 11px;
  background: transparent;
  border: 1px solid var(--border);
  color: var(--text2);
  border-radius: 2px;
  cursor: pointer;
}

.console-btn:hover {
  background: var(--hl2);
  color: #fff;
}

/* Console views */
#console-body {
  flex: 1;
  overflow: hidden;
  position: relative;
}

.con-view {
  display: none;
  height: 100%;
  overflow: auto;
}

.con-view.active {
  display: flex;
}

/* ── Tree View Grid (collapsible table) ──────────────── */
#tree-view {
  flex-direction: column;
}

.tree-table-hdr {
  display: grid;
  grid-template-columns: 240px 1fr 100px;
  background: var(--bg2);
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
  user-select: none;
}

.tree-table-hdr span {
  padding: 4px 10px;
  font-size: 11px;
  font-weight: 600;
  color: var(--text2);
  text-transform: uppercase;
  letter-spacing: .3px;
  border-right: 1px solid var(--border);
}

.tree-table-hdr span:last-child {
  border-right: none;
}

#tree-rows {
  flex: 1;
  overflow-y: auto;
}

/* Collapsible Node Row */
.tree-node-container {
  display: flex;
  flex-direction: column;
}

.tree-node-row {
  display: grid;
  grid-template-columns: 240px 1fr 100px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.02);
  cursor: pointer;
}

.tree-node-row:hover {
  background: var(--hl2);
}

.tree-node-col {
  padding: 4px 10px;
  font-family: 'JetBrains Mono', Consolas, monospace;
  font-size: 12px;
  border-right: 1px solid rgba(255,255,255,0.02);
  word-break: break-all;
  display: flex;
  align-items: center;
}

.tree-node-col:last-child {
  border-right: none;
}

.tree-node-key {
  color: var(--text);
  font-weight: 500;
}

.tree-node-key-text {
  color: #e5c07b;
}

.tree-node-value {
  color: #abb2bf;
}

/* Type Coloring */
.tree-node-value.string { color: var(--orange); }
.tree-node-value.number { color: #b5cea8; }
.tree-node-value.boolean { color: var(--blue2); }
.tree-node-value.null { color: var(--text3); }
.tree-node-value.date { color: var(--green2); }
.tree-node-value.objectid { color: var(--cyan); }
.tree-node-value.array { color: var(--purple); }
.tree-node-value.object { color: #858585; }

.tree-node-type {
  color: var(--text3);
  font-size: 11px;
}

.tree-toggle-arrow {
  font-size: 9px;
  color: var(--text3);
  margin-right: 6px;
  transition: transform .15s;
  display: inline-block;
  width: 10px;
}

.tree-toggle-arrow.expanded {
  transform: rotate(90deg);
}

.tree-toggle-spacer {
  display: inline-block;
  width: 16px;
}

.tree-node-children {
  display: none;
}

/* Raw JSON view */
#raw-view {
  padding: 8px 12px;
  font-family: 'JetBrains Mono', monospace;
  font-size: 12px;
  line-height: 1.6;
}

/* Output view */
#output-view {
  padding: 8px 12px;
  font-family: 'JetBrains Mono', monospace;
  font-size: 12px;
  line-height: 1.6;
}

.out-ok { color: var(--green3); }
.out-err { color: var(--red); }
.out-info { color: var(--text3); }
.out-warn { color: var(--yellow); }

/* ═══════════════════════════════════════════════════════════════
   STATUS BAR
═══════════════════════════════════════════════════════════════ */
#statusbar {
  height: 22px;
  background: var(--statusbar);
  display: flex;
  align-items: center;
  padding: 0 8px;
  gap: 0;
  flex-shrink: 0;
  font-size: 11px;
  color: rgba(255, 255, 255, 0.85);
  user-select: none;
}

.sb-item {
  padding: 0 10px;
  cursor: pointer;
  height: 100%;
  display: flex;
  align-items: center;
  gap: 4px;
}

.sb-item:hover {
  background: rgba(255, 255, 255, 0.15);
}

.sb-sep {
  width: 1px;
  height: 14px;
  background: rgba(255, 255, 255, 0.20);
}

.sb-right {
  margin-left: auto;
  display: flex;
  align-items: center;
  height: 100%;
}

.sb-green {
  background: #333333;
}

.sb-green:hover {
  background: #444444;
}

/* ═══════════════════════════════════════════════════════════════
   WELCOME/INTRO SCREEN (white canvas, matching Image 1)
═══════════════════════════════════════════════════════════════ */
#intro-panel {
  flex: 1;
  display: none;
  flex-direction: column;
  background: #000000;
  overflow-y: auto;
}

#intro-panel.active {
  display: flex;
}

.intro-wrap {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 20px 24px 15px;
  background: transparent;
}

.intro-title {
  font-size: 32px;
  font-weight: 800;
  color: #f3f4f6;
  text-align: center;
  line-height: 1.15;
  letter-spacing: -0.5px;
}

.gradient-text {
  background: linear-gradient(135deg, #ffffff 0%, #a1a1a1 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  display: inline-block;
}

.intro-subtitle {
  font-size: 11px;
  font-weight: 700;
  color: #64748b;
  text-transform: uppercase;
  letter-spacing: 3px;
  margin-top: 4px;
  text-align: center;
}

.intro-tagline {
  font-size: 13px;
  font-weight: 500;
  color: #94a3b8;
  margin-top: 6px;
  text-align: center;
  max-width: 520px;
  line-height: 1.5;
}

.intro-logo {
  width: 120px;
  height: 120px;
  object-fit: contain;
  margin: 12px 0;
  cursor: pointer;
  filter: drop-shadow(0 0 20px rgba(78, 201, 176, 0.15));
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.intro-logo:hover {
  transform: scale(1.08) rotate(5deg);
  filter: drop-shadow(0 0 30px rgba(78, 201, 176, 0.35));
}

/* Glassmorphism Grid */
.intro-stats-grid {
  display: flex;
  gap: 15px;
  margin: 8px 0 20px 0;
  justify-content: center;
  width: 100%;
  max-width: 440px;
}

.intro-stat-card {
  flex: 1;
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid rgba(255, 255, 255, 0.06);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-radius: 12px;
  padding: 10px 14px;
  text-align: center;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: 0 4px 30px rgba(0, 0, 0, 0.4);
}

.intro-stat-card:hover {
  transform: translateY(-4px);
  background: rgba(255, 255, 255, 0.04);
  border-color: rgba(78, 201, 176, 0.3);
  box-shadow: 0 8px 30px rgba(0, 237, 100, 0.08);
}

.intro-stat-icon-wrapper {
  display: flex;
  justify-content: center;
  align-items: center;
  margin-bottom: 4px;
  height: 20px;
}

.pulse-dot {
  width: 10px;
  height: 10px;
  background: #ffffff;
  border-radius: 50%;
  display: inline-block;
  box-shadow: 0 0 0 0 rgba(255, 255, 255, 0.7);
  animation: pulse 1.8s infinite;
}

@keyframes pulse {
  0% {
    transform: scale(0.95);
    box-shadow: 0 0 0 0 rgba(255, 255, 255, 0.7);
  }
  70% {
    transform: scale(1);
    box-shadow: 0 0 0 8px rgba(255, 255, 255, 0);
  }
  100% {
    transform: scale(0.95);
    box-shadow: 0 0 0 0 rgba(255, 255, 255, 0);
  }
}

.intro-stat-value {
  font-size: 20px;
  font-weight: 800;
  color: #ffffff;
  font-family: 'JetBrains Mono', Consolas, monospace;
  line-height: 1.2;
}

.intro-stat-label {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: #64748b;
  margin-top: 6px;
  font-weight: 600;
}

.intro-enter {
  background-color: var(--mongo);
  color: #ffffff;
  font-size: 14px;
  font-weight: 700;
  padding: 10px 28px;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: 0 8px 24px rgba(0, 104, 74, 0.35);
  display: flex;
  align-items: center;
  gap: 8px;
}

.intro-enter:hover {
  background-color: #ffffff;
  color: #000000;
  transform: translateY(-2px);
  box-shadow: 0 12px 30px rgba(255, 255, 255, 0.25);
}

.intro-footer-row {
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 10px 24px;
  background: transparent;
  border-top: 1px solid var(--border);
  flex-shrink: 0;
}

.intro-dev {
  font-size: 13px;
  color: #64748b;
  font-weight: 500;
  text-align: center;
}

.intro-dev a {
  color: #cccccc;
  text-decoration: none;
  font-weight: 700;
  border-bottom: 1px dashed rgba(255, 255, 255, 0.3);
  transition: all 0.2s ease;
  margin-left: 3px;
}

.intro-dev a:hover {
  color: #ffffff;
  border-bottom-color: #ffffff;
}

/* ═══════════════════════════════════════════════════════════════
   SCHEMA DETAILS MODAL
═══════════════════════════════════════════════════════════════ */
.modal-bg {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.65);
  z-index: 800;
  align-items: center;
  justify-content: center;
}

.modal-bg.open {
  display: flex;
}

.modal-win {
  background: #252526;
  border: 1px solid #454545;
  border-radius: 4px;
  width: 760px;
  max-width: 94vw;
  max-height: 85vh;
  display: flex;
  flex-direction: column;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.7);
}

.modal-titlebar {
  height: 32px;
  background: #2d2d2d;
  display: flex;
  align-items: center;
  padding: 0 12px;
  border-bottom: 1px solid #3c3c3c;
  flex-shrink: 0;
}

.modal-icon {
  font-size: 14px;
  margin-right: 8px;
}

.modal-title {
  font-size: 13px;
  font-weight: 600;
  color: #cccccc;
}

.modal-close-btn {
  margin-left: auto;
  background: none;
  border: none;
  color: #858585;
  font-size: 18px;
  cursor: pointer;
  padding: 0 4px;
  line-height: 1;
  border-radius: 2px;
}

.modal-close-btn:hover {
  background: rgba(255, 255, 255, 0.1);
  color: #fff;
}

.modal-coll-header {
  padding: 12px 16px;
  border-bottom: 1px solid #3c3c3c;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-shrink: 0;
}

.modal-coll-name {
  font-size: 14px;
  font-weight: 700;
  color: #9cdcfe;
  display: flex;
  align-items: center;
  gap: 6px;
}

.modal-coll-count {
  font-size: 12px;
  color: #858585;
}

.modal-tabs {
  display: flex;
  border-bottom: 1px solid #3c3c3c;
  flex-shrink: 0;
  background: #2d2d2d;
}

.modal-tab {
  padding: 8px 16px;
  font-size: 12px;
  color: #9d9d9d;
  cursor: pointer;
  border-bottom: 2px solid transparent;
  display: flex;
  align-items: center;
  gap: 6px;
}

.modal-tab.active {
  color: #cccccc;
  border-bottom-color: #007acc;
}

.modal-tab:hover {
  color: #cccccc;
  background: rgba(255, 255, 255, 0.05);
}

.modal-body {
  flex: 1;
  overflow-y: auto;
}

/* Schema table */
.schema-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 12px;
}

.schema-table th {
  padding: 7px 14px;
  text-align: left;
  font-weight: 600;
  color: #9d9d9d;
  background: #2d2d2d;
  border-bottom: 1px solid #3c3c3c;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: .3px;
}

.schema-table td {
  padding: 7px 14px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
  font-family: 'JetBrains Mono', monospace;
}

.schema-table tr:hover td {
  background: rgba(255, 255, 255, 0.04);
}

.td-num {
  color: #858585;
  width: 40px;
}

.td-field {
  color: #9cdcfe;
}

.td-type {
  color: #4ec9b0;
}

.td-sample {
  color: #ce9178;
  font-size: 11px;
  max-width: 260px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* Relations joins */
.rel-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 12px;
}

.rel-table th {
  padding: 7px 14px;
  text-align: left;
  font-weight: 600;
  color: #9d9d9d;
  background: #2d2d2d;
  border-bottom: 1px solid #3c3c3c;
  font-size: 11px;
  text-transform: uppercase;
}

.rel-table td {
  padding: 8px 14px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
  font-family: 'JetBrains Mono', monospace;
  font-size: 12px;
}

.rel-table tr:hover td {
  background: rgba(255, 255, 255, 0.04);
}

.rel-from {
  color: #9cdcfe;
}

.rel-arrow {
  color: #23d18b;
  font-weight: 700;
  font-size: 14px;
}

.rel-to {
  color: #4ec9b0;
}

.rel-card {
  color: #858585;
  font-size: 11px;
  font-family: inherit;
}

/* Command palette */
#palette {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.5);
  z-index: 900;
  align-items: flex-start;
  justify-content: center;
  padding-top: 100px;
}

#palette.open {
  display: flex;
}

#palette-box {
  width: 520px;
  background: #252526;
  border: 1px solid #454545;
  border-radius: 4px;
  overflow: hidden;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.6);
}

#palette-input {
  width: 100%;
  padding: 12px 14px;
  background: transparent;
  border: none;
  border-bottom: 1px solid #3c3c3c;
  color: #fff;
  font-size: 14px;
  outline: none;
  font-family: inherit;
}

.p-item {
  padding: 8px 14px;
  font-size: 12px;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 10px;
  color: #ccc;
}

.p-item:hover, .p-item.sel {
  background: var(--hl);
  color: #fff;
}

.p-icon {
  width: 18px;
  text-align: center;
  color: #858585;
}

.p-key {
  margin-left: auto;
  font-size: 10px;
  background: rgba(255, 255, 255, 0.1);
  padding: 2px 6px;
  border-radius: 2px;
  color: #aaa;
  font-family: 'JetBrains Mono', monospace;
}

/* ═══════════════════════════════════════════════════════════════
   VS CODE DARK PLUS EDITOR THEME & INTELLISENSE STYLING
   ═══════════════════════════════════════════════════════════════ */
.CodeMirror {
  background: #1e1e1e;
  color: #d4d4d4;
  line-height: 1.5;
  font-family: 'Consolas', 'JetBrains Mono', monospace;
}

.CodeMirror-gutters {
  background: #1e1e1e !important;
  border-right: 1px solid #2d2d2d !important;
}

.CodeMirror-linenumber {
  color: #858585 !important;
}

.CodeMirror-cursor {
  border-left: 2px solid #aeafad !important;
}

.CodeMirror-activeline-background {
  background: rgba(255, 255, 255, 0.04) !important;
}

.CodeMirror-selected {
  background: #264f78 !important;
}

.CodeMirror-focused .CodeMirror-selected {
  background: #264f78 !important;
}

/* VS Code Dark+ Syntax Colors */
.cm-s-default .cm-keyword { color: #c586c0 !important; font-weight: bold; }
.cm-s-default .cm-atom { color: #569cd6 !important; }
.cm-s-default .cm-number { color: #b5cea8 !important; }
.cm-s-default .cm-def { color: #9cdcfe !important; }
.cm-s-default .cm-variable { color: #9cdcfe !important; }
.cm-s-default .cm-variable-2 { color: #4ec9b0 !important; }
.cm-s-default .cm-property { color: #dcdcaa !important; }
.cm-s-default .cm-operator { color: #d4d4d4 !important; }
.cm-s-default .cm-comment { color: #6a9955 !important; font-style: italic; }
.cm-s-default .cm-string { color: #ce9178 !important; }
.cm-s-default .cm-string-2 { color: #ce9178 !important; }
.cm-s-default .cm-meta { color: #569cd6 !important; }
.cm-s-default .cm-qualifier { color: #d7ba7d !important; }
.cm-s-default .cm-builtin { color: #4ec9b0 !important; }
.cm-s-default .cm-bracket { color: #ffd700 !important; }
.cm-s-default .cm-tag { color: #569cd6 !important; }

/* VS Code IntelliSense Hint Box Styling */
.CodeMirror-hints {
  background: #252526 !important;
  border: 1px solid #454545 !important;
  border-radius: 4px !important;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.5) !important;
  padding: 4px 0 !important;
  font-family: 'Consolas', 'JetBrains Mono', monospace !important;
  font-size: 12px !important;
  z-index: 1000 !important;
  max-height: 220px !important;
}

.CodeMirror-hint {
  color: #cccccc !important;
  padding: 5px 10px !important;
  border-radius: 2px !important;
  margin: 0 4px !important;
  white-space: nowrap !important;
}

li.CodeMirror-hint-active {
  background-color: #04395e !important;
  color: #ffffff !important;
}

/* Custom Dataset Actions & Badges */
.db-action-btn {
  width: 100%;
  background: var(--bg3);
  border: 1px solid var(--border);
  color: var(--text);
  border-radius: 3px;
  padding: 6px 10px;
  font-size: 11px;
  font-weight: 500;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
}

.db-action-btn:hover {
  background: var(--hl);
  border-color: var(--blue);
  color: #ffffff;
}

.custom-badge {
  background: rgba(78, 201, 176, 0.15);
  color: #00ed64;
  border: 1px solid rgba(78, 201, 176, 0.3);
  border-radius: 3px;
  font-size: 9px;
  padding: 1px 4px;
  margin-left: 6px;
  font-weight: 700;
  text-transform: uppercase;
  vertical-align: middle;
  display: inline-block;
  letter-spacing: 0.3px;
}

.delete-custom-btn {
  color: var(--text3);
  opacity: 0.6;
  transition: all 0.2s ease;
}
.delete-custom-btn:hover {
  color: #ff5252 !important;
  opacity: 1;
}

/* ═══════════════════════════════════════════════════════════════
   EXAM PORTAL — COMPLETE STYLING SYSTEM
   All components match the existing IDE aesthetic exactly.
═══════════════════════════════════════════════════════════════ */

/* ── Intro page: Exam Portal button ─────────────────────── */
.intro-exam-btn {
  background: transparent;
  color: var(--green2);
  font-size: 13px;
  font-weight: 600;
  padding: 8px 28px;
  border: 1px solid var(--green);
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 10px;
  font-family: 'JetBrains Mono', monospace;
}
.intro-exam-btn:hover {
  background: rgba(22, 130, 93, 0.15);
  border-color: var(--green2);
  color: #fff;
  transform: translateY(-1px);
  box-shadow: 0 4px 16px rgba(46, 200, 176, 0.2);
}

/* ── Exam overlay panels (full-viewport) ─────────────────── */
.exam-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: var(--bg);
  z-index: 700;
  flex-direction: column;
  font-family: 'Segoe UI', system-ui, sans-serif;
}
.exam-overlay.active {
  display: flex;
}

/* ── Exam top bar ────────────────────────────────────────── */
.exam-topbar {
  height: 36px;
  background: rgba(255,255,255,0.02);
  border-bottom: 1px solid rgba(255,255,255,0.06);
  display: flex;
  align-items: center;
  padding: 0 12px;
  gap: 8px;
  flex-shrink: 0;
}
.exam-topbar-title {
  font-size: 12px;
  font-weight: 700;
  color: var(--text);
  font-family: 'JetBrains Mono', monospace;
}
.exam-topbar-back {
  display: flex;
  align-items: center;
  gap: 4px;
  font-size: 10px;
  color: #888;
  cursor: pointer;
  padding: 3px 6px;
  border-radius: 3px;
  background: none;
  border: none;
  transition: all .15s;
}
.exam-topbar-back:hover {
  background: rgba(255,255,255,0.05);
  color: var(--text);
}

/* ── Exam body (scrollable content area) ─────────────────── */
.exam-body {
  flex: 1;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 40px 24px;
}

/* ── Role selection cards ─────────────────────────────────── */
.exam-role-grid {
  display: flex;
  gap: 24px;
  justify-content: center;
  flex-wrap: wrap;
  margin-top: 32px;
}
.exam-role-card {
  width: 240px;
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 32px 24px;
  cursor: pointer;
  text-align: center;
  transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
}
.exam-role-card:hover {
  border-color: var(--green2);
  background: rgba(78, 201, 176, 0.05);
  transform: translateY(-4px);
  box-shadow: 0 12px 40px rgba(0,0,0,0.4), 0 0 0 1px rgba(78,201,176,0.2);
}
.exam-role-icon {
  width: 56px;
  height: 56px;
  background: rgba(78, 201, 176, 0.08);
  border: 1px solid rgba(78, 201, 176, 0.2);
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.exam-role-icon svg { fill: var(--green2); }
.exam-role-name {
  font-size: 18px;
  font-weight: 700;
  color: var(--text);
}
.exam-role-desc {
  font-size: 12px;
  color: var(--text3);
  line-height: 1.5;
}

/* ── Form card (room creation, join) ─────────────────────── */
.exam-form-card {
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 32px;
  width: 100%;
  max-width: 480px;
}
.exam-form-title {
  font-size: 15px;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 6px;
}
.exam-form-sub {
  font-size: 12px;
  color: var(--text3);
  margin-bottom: 24px;
  font-family: 'JetBrains Mono', monospace;
}

/* ── Room ID badge ───────────────────────────────────────── */
.exam-room-id-badge {
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--bg);
  border: 1px solid var(--border2);
  border-radius: 6px;
  padding: 10px 16px;
  margin-bottom: 20px;
  cursor: pointer;
  transition: border-color .15s;
}
.exam-room-id-badge:hover { border-color: var(--green2); }
.exam-room-id-text {
  font-family: 'JetBrains Mono', monospace;
  font-size: 22px;
  font-weight: 700;
  color: var(--green2);
  letter-spacing: 3px;
  flex: 1;
  text-align: center;
}
.exam-room-id-copy {
  color: var(--text3);
  cursor: pointer;
  flex-shrink: 0;
}

/* ── Form inputs ─────────────────────────────────────────── */
.exam-field {
  margin-bottom: 16px;
}
.exam-label {
  display: block;
  font-size: 11px;
  font-weight: 600;
  color: var(--text2);
  text-transform: uppercase;
  letter-spacing: .5px;
  margin-bottom: 6px;
}
.exam-input {
  width: 100%;
  padding: 8px 12px;
  background: var(--bg);
  border: 1px solid var(--border2);
  border-radius: 4px;
  color: var(--text);
  font-family: 'JetBrains Mono', monospace;
  font-size: 13px;
  outline: none;
  transition: border-color .15s;
}
.exam-input:focus { border-color: var(--green2); }
.exam-input::placeholder { color: var(--text3); }
.exam-select {
  width: 100%;
  padding: 8px 12px;
  background: var(--bg);
  border: 1px solid var(--border2);
  border-radius: 4px;
  color: var(--text);
  font-family: inherit;
  font-size: 13px;
  outline: none;
  cursor: pointer;
  transition: border-color .15s;
}
.exam-select:focus { border-color: var(--green2); }
.exam-input-err {
  font-size: 11px;
  color: var(--red);
  margin-top: 4px;
  font-family: 'JetBrains Mono', monospace;
}
.exam-input.has-err { border-color: var(--red); }

/* ── Timed toggle ────────────────────────────────────────── */
.exam-toggle-row {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 16px;
}
.exam-toggle {
  position: relative;
  width: 36px;
  height: 20px;
  cursor: pointer;
}
.exam-toggle input { display: none; }
.exam-toggle-track {
  position: absolute;
  inset: 0;
  background: var(--bg4);
  border: 1px solid var(--border2);
  border-radius: 10px;
  transition: background .2s;
}
.exam-toggle input:checked ~ .exam-toggle-track {
  background: var(--green);
  border-color: var(--green2);
}
.exam-toggle-thumb {
  position: absolute;
  top: 2px;
  left: 2px;
  width: 14px;
  height: 14px;
  background: #fff;
  border-radius: 50%;
  transition: transform .2s;
}
.exam-toggle input:checked ~ .exam-toggle-thumb { transform: translateX(16px); }
.exam-toggle-label { font-size: 12px; color: var(--text2); }

/* ── Buttons ─────────────────────────────────────────────── */
.exam-btn {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 8px 18px;
  font-size: 12px;
  font-weight: 600;
  border-radius: 5px;
  border: none;
  cursor: pointer;
  transition: all .15s;
  font-family: inherit;
  white-space: nowrap;
}
.exam-btn:disabled { opacity: 0.4; cursor: not-allowed; }
.exam-btn-green {
  background: #2f9e44;
  color: #fff;
}
.exam-btn-green:hover:not(:disabled) { background: #37b24d; }
.exam-btn-red {
  background: #6b1a19;
  color: #f48771;
  border: 1px solid #a83332;
}
.exam-btn-red:hover:not(:disabled) {
  background: #8b2221;
  color: #fff;
}
.exam-btn-secondary {
  background: rgba(255,255,255,0.04);
  color: #aaa;
  border: 1px solid rgba(255,255,255,0.08);
  padding: 3px 8px;
  height: 24px;
  font-size: 10px;
  border-radius: 4px;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}
.exam-btn-secondary:hover:not(:disabled) {
  background: rgba(255,255,255,0.08);
  color: var(--text);
  border-color: rgba(255,255,255,0.12);
}
.exam-btn-full { width: 100%; justify-content: center; }

/* ── Status chips ────────────────────────────────────────── */
.exam-status-chip {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 8px;
  border-radius: 10px;
  font-size: 9px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .6px;
  font-family: 'JetBrains Mono', monospace;
}
.exam-status-chip::before {
  content: '●';
  font-size: 7px;
}
.exam-chip-waiting {
  background: rgba(210, 153, 34, 0.12);
  color: #d09922;
  border: 1px solid rgba(210, 153, 34, 0.25);
}
.exam-chip-live {
  background: rgba(22, 130, 93, 0.12);
  color: var(--green2);
  border: 1px solid rgba(22, 130, 93, 0.3);
  animation: exam-live-pulse 2s infinite;
}
/* Top bar buttons */
.topbar-btn {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 8px;
  height: 22px;
  font-size: 9px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .4px;
  border-radius: 3px;
  background: rgba(255,255,255,0.03);
  border: 1px solid rgba(255,255,255,0.06);
  color: #888;
  cursor: pointer;
  transition: all .12s;
}
.topbar-btn:hover {
  background: rgba(255,255,255,0.06);
  color: var(--text);
  border-color: rgba(255,255,255,0.1);
}
.topbar-btn-green {
  background: #2f9e44;
  border-color: #2f9e44;
  color: #fff;
}
.topbar-btn-green:hover {
  background: #37b24d;
  border-color: #37b24d;
  color: #fff;
}
.topbar-btn-red {
  background: rgba(218, 54, 51, 0.1);
  border-color: rgba(218, 54, 51, 0.2);
  color: #ff6b6b;
}
.topbar-btn-red:hover {
  background: rgba(218, 54, 51, 0.15);
  border-color: rgba(218, 54, 51, 0.3);
}

.exam-chip-ended {
  background: rgba(218, 54, 51, 0.12);
  color: var(--red);
  border: 1px solid rgba(218, 54, 51, 0.3);
}
@keyframes exam-live-pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.7; }
}

/* ── Mentor Dashboard layout ─────────────────────────────── */
.exam-dash-shell {
  flex: 1;
  display: flex;
  overflow: hidden;
}
.exam-dash-left {
  width: 240px;
  background: var(--bg2);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  flex-shrink: 0;
  overflow: hidden;
}
.exam-dash-main {
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  min-width: 0;
}
.exam-dash-right {
  width: 260px;
  background: var(--bg2);
  border-left: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  flex-shrink: 0;
  overflow: hidden;
}

/* ── Sidebar section in dash ─────────────────────────────── */
.exam-sidebar-hdr {
  height: 35px;
  background: var(--bg2);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  padding: 0 12px;
  font-size: 11px;
  font-weight: 700;
  color: #bbbbbb;
  text-transform: uppercase;
  letter-spacing: .5px;
  flex-shrink: 0;
}
.exam-sidebar-body {
  flex: 1;
  overflow-y: auto;
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.exam-sidebar-row {
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.exam-sidebar-key {
  font-size: 10px;
  font-weight: 600;
  color: var(--text3);
  text-transform: uppercase;
  letter-spacing: .4px;
}
.exam-sidebar-val {
  font-size: 12px;
  color: var(--text);
  font-family: 'JetBrains Mono', monospace;
}
.exam-timer-display {
  font-family: 'JetBrains Mono', monospace;
  font-size: 20px;
  font-weight: 700;
  color: var(--green2);
  letter-spacing: 2px;
}
.exam-timer-warning { color: var(--yellow); }
.exam-timer-critical { color: var(--red); animation: exam-live-pulse 0.8s infinite; }

/* ── Tab bar in dash main panel ──────────────────────────── */
.exam-tabbar {
  height: 35px;
  background: var(--bg2);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: stretch;
  flex-shrink: 0;
}
.exam-tab {
  padding: 0 18px;
  font-size: 12px;
  color: var(--text2);
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 6px;
  border-right: 1px solid var(--border);
  border-bottom: 2px solid transparent;
  user-select: none;
  transition: all .1s;
}
.exam-tab:hover { background: var(--hl2); color: var(--text); }
.exam-tab.active {
  background: var(--bg);
  color: var(--text);
  border-bottom-color: var(--green2);
}

/* ── Tab content panes ───────────────────────────────────── */
.exam-tab-pane {
  display: none;
  flex: 1;
  overflow: hidden;
  flex-direction: column;
}
.exam-tab-pane.active { display: flex; }

/* ── Question builder ────────────────────────────────────── */
.exam-qbuilder {
  display: flex;
  flex: 1;
  overflow: hidden;
  background: #0f130f;
}
.exam-qlist {
  width: 240px;
  border-right: 1px solid var(--exam-line, #252b25);
  display: flex;
  flex-direction: column;
  flex-shrink: 0;
  background: #101410;
}
.exam-qlist-hdr {
  height: 32px;
  border-bottom: 1px solid var(--exam-line, #252b25);
  display: flex;
  align-items: center;
  padding: 0 8px;
  gap: 6px;
  flex-shrink: 0;
}
.exam-qlist-hdr-title {
  font-size: 10px;
  font-weight: 600;
  color: var(--exam-muted, #7d877d);
  text-transform: uppercase;
  letter-spacing: .5px;
  flex: 1;
}
.exam-qlist-body {
  flex: 1;
  overflow-y: auto;
}
.exam-qlist-empty {
  padding: 20px 12px;
  font-size: 11px;
  color: var(--exam-muted, #7d877d);
  font-family: 'JetBrains Mono', monospace;
  text-align: center;
  line-height: 1.6;
}
.exam-q-card {
  padding: 8px 10px;
  border-bottom: 1px solid #1a201a;
  cursor: pointer;
  transition: background .1s;
  display: flex;
  flex-direction: column;
  gap: 3px;
}
.exam-q-card:hover { background: #141a14; }
.exam-q-card.active {
  background: rgba(184, 216, 111, 0.07);
  border-left: 2px solid var(--exam-accent, #b8d86f);
}
.exam-q-card-top {
  display: flex;
  align-items: center;
  gap: 5px;
}
.exam-q-num {
  font-size: 10px;
  font-weight: 600;
  color: var(--exam-muted, #7d877d);
  font-family: 'JetBrains Mono', monospace;
  flex-shrink: 0;
}
.exam-q-type-chip {
  font-size: 8px;
  font-weight: 700;
  padding: 1px 5px;
  border-radius: 10px;
  text-transform: uppercase;
  letter-spacing: .5px;
  flex-shrink: 0;
}
.exam-q-type-query {
  background: rgba(22, 130, 93, 0.15);
  color: var(--green2);
  border: 1px solid rgba(22, 130, 93, 0.3);
}
.exam-q-type-sql {
  background: rgba(56, 189, 248, 0.15);
  color: #38bdf8;
  border: 1px solid rgba(56, 189, 248, 0.3);
}
.exam-q-type-mcq {
  background: rgba(0, 122, 204, 0.15);
  color: var(--blue2);
  border: 1px solid rgba(0, 122, 204, 0.25);
}
.exam-q-type-coding {
  background: rgba(230, 126, 34, 0.15);
  color: #e67e22;
  border: 1px solid rgba(230, 126, 34, 0.3);
}
.exam-q-marks-badge {
  margin-left: auto;
  font-size: 9px;
  color: var(--yellow);
  font-family: 'JetBrains Mono', monospace;
  flex-shrink: 0;
}
.exam-q-preview {
  font-size: 10px;
  color: var(--exam-muted, #7d877d);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* Question type buttons in sidebar */
.qtype-btn {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  padding: 4px 6px;
  height: 24px;
  font-size: 9px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .5px;
  border-radius: 3px;
  background: #141a14;
  border: 1px solid var(--exam-line, #252b25);
  color: var(--exam-muted, #7d877d);
  cursor: pointer;
  transition: all .12s;
}
.qtype-btn:hover {
  background: #1a211a;
  color: #d8e0d5;
  border-color: #354035;
}
.qtype-btn[data-type="query"]:hover { border-color: var(--exam-accent, #b8d86f); color: var(--exam-accent, #b8d86f); }
.qtype-btn[data-type="sql"]:hover { border-color: #38bdf8; color: #38bdf8; }
.qtype-btn[data-type="mcq"]:hover { border-color: #4fc1ff; color: #4fc1ff; }
.qtype-btn[data-type="coding"]:hover { border-color: #ce9178; color: #ce9178; }

/* Attached media thumbnails (question editor) */
.exam-media-card {
  position: relative;
  width: 116px;
  border: 1px solid var(--border2);
  border-radius: 5px;
  overflow: hidden;
  background: var(--bg);
}
.exam-media-remove {
  position: absolute;
  top: 3px;
  right: 3px;
  width: 18px;
  height: 18px;
  padding: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, 0.25);
  background: rgba(0, 0, 0, 0.72);
  color: #fff;
  font-size: 14px;
  font-weight: 700;
  line-height: 1;
  cursor: pointer;
  opacity: 0;
  transition: opacity .12s, background .12s;
}
.exam-media-card:hover .exam-media-remove,
.exam-media-remove:focus-visible {
  opacity: 1;
}
.exam-media-remove:hover {
  background: var(--red);
  border-color: var(--red);
}
.exam-q-card-actions {
  display: flex;
  gap: 4px;
  margin-left: auto;
}

/* ── Question editor form ─────────────────────────────────── */
.exam-qeditor {
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow-y: auto;
  padding: 16px;
  gap: 12px;
  background: #0f130f;
}
.exam-qeditor-empty {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 16px;
  padding: 40px;
}
.exam-qeditor-type-row {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}
.exam-fieldset {
  background: var(--exam-surface, #111411);
  border: 1px solid var(--exam-line, #252b25);
  border-radius: 6px;
  padding: 14px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.exam-fieldset-title {
  font-size: 10px;
  font-weight: 600;
  color: var(--exam-muted, #7d877d);
  text-transform: uppercase;
  letter-spacing: .5px;
  margin-bottom: 4px;
}
.exam-textarea {
  width: 100%;
  padding: 8px 10px;
  background: #0d110d;
  border: 1px solid var(--exam-line, #252b25);
  border-radius: 4px;
  color: var(--text);
  font-family: 'Segoe UI', system-ui, sans-serif;
  font-size: 12px;
  line-height: 1.5;
  outline: none;
  resize: vertical;
  min-height: 70px;
  transition: border-color .15s;
}
.exam-textarea:focus { border-color: var(--exam-accent, #b8d86f); }

/* Mini CodeMirror wrapper for expected query */
.exam-mini-editor {
  border: 1px solid var(--border2);
  border-radius: 4px;
  overflow: hidden;
  position: relative;
  min-height: 112px;
}
.exam-mini-editor.frozen { opacity: 0.6; pointer-events: none; }
.exam-frozen-overlay {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0,0,0,0.5);
  z-index: 5;
  pointer-events: none;
}
.exam-frozen-overlay svg { color: var(--green2); fill: var(--green2); }
.exam-frozen-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 12px;
  background: rgba(22, 130, 93, 0.15);
  border: 1px solid rgba(22, 130, 93, 0.4);
  border-radius: 4px;
  font-size: 11px;
  color: var(--green2);
  font-family: 'JetBrains Mono', monospace;
}

/* ── MCQ option builder ──────────────────────────────────── */
.exam-mcq-option-row {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 0;
  border-bottom: 1px solid rgba(255,255,255,0.03);
}
.exam-mcq-label {
  font-size: 12px;
  font-weight: 700;
  color: var(--text3);
  font-family: 'JetBrains Mono', monospace;
  width: 22px;
  flex-shrink: 0;
}
.exam-mcq-correct-radio {
  width: 14px;
  height: 14px;
  accent-color: var(--green2);
  flex-shrink: 0;
  cursor: pointer;
}

/* ── Dataset tab ─────────────────────────────────────────── */
.exam-dataset-pane {
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}
.exam-dataset-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 12px;
}
.exam-dataset-table th {
  text-align: left;
  padding: 6px 10px;
  font-size: 10px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .4px;
  color: var(--text3);
  border-bottom: 1px solid var(--border);
}
.exam-dataset-table td {
  padding: 8px 10px;
  color: var(--text);
  border-bottom: 1px solid rgba(255,255,255,0.03);
  vertical-align: middle;
}
.exam-dataset-table tr:hover td { background: var(--hl2); }
.exam-dataset-coll {
  font-family: 'JetBrains Mono', monospace;
  font-size: 11px;
  color: var(--cyan);
}

/* ── Participants panel ──────────────────────────────────── */
.exam-participants-hdr {
  height: 35px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  padding: 0 12px;
  gap: 8px;
  flex-shrink: 0;
}
.exam-participants-title {
  font-size: 11px;
  font-weight: 700;
  color: #bbbbbb;
  text-transform: uppercase;
  letter-spacing: .5px;
  flex: 1;
}
.exam-participants-count {
  font-size: 11px;
  color: var(--green2);
  font-family: 'JetBrains Mono', monospace;
}
.exam-participants-body {
  flex: 1;
  overflow-y: auto;
}
.exam-participant-row {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  padding: 8px 12px;
  border-bottom: 1px solid rgba(255,255,255,0.03);
}
.exam-participant-row:hover { background: var(--hl2); }
.exam-participant-icon {
  width: 28px;
  height: 28px;
  background: rgba(78, 201, 176, 0.1);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.exam-participant-icon svg { fill: var(--green2); }
.exam-participant-info { flex: 1; min-width: 0; }
.exam-participant-name {
  font-size: 12px;
  font-weight: 600;
  color: var(--text);
  font-family: 'JetBrains Mono', monospace;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.exam-participant-meta {
  font-size: 11px;
  color: var(--text3);
  display: flex;
  gap: 6px;
}
.exam-participant-branch {
  background: rgba(78, 201, 176, 0.1);
  color: var(--green2);
  padding: 0 5px;
  border-radius: 3px;
  font-size: 10px;
  font-weight: 600;
}
.exam-participant-time {
  font-size: 10px;
  color: var(--text3);
}
.exam-participants-empty {
  padding: 20px 12px;
  font-size: 12px;
  color: var(--text3);
  font-family: 'JetBrains Mono', monospace;
  text-align: center;
}

/* ── Leaderboard table ────────────────────────────────────── */
.exam-lb-wrap {
  flex: 1;
  overflow: auto;
}
.exam-lb-hdr {
  height: 35px;
  background: var(--bg2);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  padding: 0 16px;
  gap: 10px;
  flex-shrink: 0;
}
.exam-lb-title {
  font-size: 11px;
  font-weight: 700;
  color: #bbbbbb;
  text-transform: uppercase;
  letter-spacing: .5px;
}
.exam-lb-refresh-dot {
  width: 8px;
  height: 8px;
  background: var(--green2);
  border-radius: 50%;
}
.exam-lb-refresh-dot.pulsing { animation: pulse 1s infinite; }
.exam-lb-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 12px;
}
.exam-lb-table th {
  text-align: left;
  padding: 7px 14px;
  font-size: 10px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .4px;
  color: var(--text3);
  background: var(--bg2);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 1;
}
.exam-lb-table td {
  padding: 6px 10px;
  color: var(--text);
  border-bottom: 1px solid rgba(255,255,255,0.03);
  vertical-align: middle;
  font-size: 11px;
}
.exam-lb-table tr:hover td { background: rgba(255,255,255,0.02); }
.exam-lb-rank {
  font-family: 'JetBrains Mono', monospace;
  font-weight: 700;
  font-size: 12px;
  color: var(--text3);
  text-align: center;
}
.exam-lb-rank-1 { color: #F0B429; }
.exam-lb-rank-2 { color: #C0C0C0; }
.exam-lb-rank-3 { color: #CD7F32; }
.exam-lb-row-1 td:first-child { border-left: 3px solid #F0B429; }
.exam-lb-row-2 td:first-child { border-left: 3px solid #C0C0C0; }
.exam-lb-row-3 td:first-child { border-left: 3px solid #CD7F32; }
.exam-lb-name {
  font-weight: 600;
  color: var(--text);
  font-family: 'JetBrains Mono', monospace;
}
.exam-lb-score {
  font-family: 'JetBrains Mono', monospace;
  font-weight: 700;
  color: var(--green2);
}
.exam-lb-accuracy {
  font-family: 'JetBrains Mono', monospace;
  color: var(--text2);
}
.exam-lb-time {
  font-size: 10px;
  color: var(--text3);
  font-family: 'JetBrains Mono', monospace;
}
.exam-lb-countdown {
  color: var(--exam-accent, #b8d86f);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}
/* Under a minute left: warn the mentor before the window closes. */
.exam-lb-countdown.is-low {
  color: #ff6b6b;
  font-weight: 700;
}

/* ── Student exam layout ─────────────────────────────────── */
.exam-student-shell {
  flex: 1;
  display: flex;
  overflow: hidden;
}
.exam-qnav {
  width: 260px;
  background: rgba(255,255,255,0.02);
  border-right: 1px solid rgba(255,255,255,0.06);
  display: flex;
  flex-direction: column;
  flex-shrink: 0;
  overflow: hidden;
}
.exam-qnav-hdr {
  height: 32px;
  border-bottom: 1px solid rgba(255,255,255,0.06);
  display: flex;
  align-items: center;
  padding: 0 10px;
  font-size: 10px;
  font-weight: 600;
  color: #888;
  text-transform: uppercase;
  letter-spacing: .5px;
  flex-shrink: 0;
}
.exam-qnav-body { flex: 1; overflow-y: auto; }
.exam-qnav-card {
  padding: 8px 10px;
  border-bottom: 1px solid rgba(255,255,255,0.04);
  cursor: pointer;
  transition: background .1s;
  display: flex;
  flex-direction: column;
  gap: 3px;
  position: relative;
}
.exam-qnav-card:hover { background: rgba(255,255,255,0.03); }
.exam-qnav-card.active { background: rgba(22,130,93,0.1); border-left: 2px solid var(--green2); }
.exam-q-status-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  flex-shrink: 0;
}
.exam-q-status-unattempted { background: #666; opacity: 0.5; }
.exam-q-status-draft { background: #d09922; }
.exam-q-status-submitted { background: var(--green2); }

/* ── Student exam main area ──────────────────────────────── */
.exam-student-main {
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  min-width: 0;
  background: #121610;
}
.exam-question-display {
  padding: 12px 16px;
  background: rgba(255,255,255,0.02);
  border-bottom: 1px solid rgba(255,255,255,0.06);
  border-left: 3px solid var(--green2);
  flex-shrink: 0;
  max-height: 200px;
  overflow-y: auto;
}
.exam-question-header {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 6px;
}
.exam-question-number {
  font-size: 10px;
  font-weight: 600;
  color: #888;
  font-family: 'JetBrains Mono', monospace;
}
.exam-question-marks {
  margin-left: auto;
  font-size: 10px;
  color: var(--yellow);
  font-family: 'JetBrains Mono', monospace;
}
.exam-question-text {
  font-size: 13px;
  color: var(--text);
  line-height: 1.6;
  font-family: 'Segoe UI', system-ui, sans-serif;
}

/* ── MCQ interface ───────────────────────────────────────── */
.exam-mcq-options {
  flex: 1;
  overflow-y: auto;
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.exam-mcq-option-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 14px;
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: 4px;
  cursor: pointer;
  transition: all .15s;
  user-select: none;
}
.exam-mcq-option-item:hover {
  border-color: var(--border2);
  background: var(--hl2);
}
.exam-mcq-option-item:focus {
  outline: 2px solid var(--green2);
  outline-offset: 1px;
}
.exam-mcq-option-item.selected {
  border-left: 3px solid var(--green2);
  background: rgba(22, 130, 93, 0.08);
}
.exam-mcq-option-indicator {
  font-size: 12px;
  font-weight: 700;
  color: var(--text3);
  font-family: 'JetBrains Mono', monospace;
  width: 28px;
  text-align: center;
  flex-shrink: 0;
}
.exam-mcq-option-item.selected .exam-mcq-option-indicator {
  color: var(--green2);
}
.exam-mcq-option-text {
  font-size: 13px;
  color: var(--text);
  font-family: 'JetBrains Mono', monospace;
  flex: 1;
}

/* ── Student console (two-tab) ───────────────────────────── */
.exam-student-console {
  height: 220px;
  background: var(--bg);
  border-top: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  flex-shrink: 0;
}
.exam-console-hdr {
  height: 28px;
  background: var(--bg2);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: stretch;
  flex-shrink: 0;
}
.exam-console-tab {
  padding: 0 16px;
  font-size: 12px;
  color: var(--text2);
  cursor: pointer;
  border-right: 1px solid var(--border);
  display: flex;
  align-items: center;
  border-bottom: 2px solid transparent;
  user-select: none;
  transition: all .1s;
}
.exam-console-tab:hover { color: var(--text); background: var(--hl2); }
.exam-console-tab.active {
  color: var(--text);
  border-bottom-color: var(--blue);
  background: var(--bg);
}
.exam-console-pane {
  display: none;
  flex: 1;
  overflow: auto;
  padding: 8px 14px;
  font-family: 'JetBrains Mono', monospace;
  font-size: 12px;
  line-height: 1.6;
}
.exam-console-pane.active { display: flex; flex-direction: column; }
.exam-console-hint {
  font-size: 11px;
  color: var(--text3);
  font-style: italic;
  margin-top: 4px;
  border-top: 1px dashed rgba(255,255,255,0.06);
  padding-top: 6px;
}

/* ── Waiting room ────────────────────────────────────────── */
.exam-wait-content {
  max-width: 560px;
  width: 100%;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
}
.exam-wait-title {
  font-size: 20px;
  font-weight: 700;
  color: #fff;
  font-family: 'JetBrains Mono', monospace;
  letter-spacing: -.02em;
}
.exam-wait-status {
  font-size: 12px;
  color: var(--exam-muted, #7d877d);
  font-family: 'JetBrains Mono', monospace;
  background: var(--exam-surface, #111411);
  border: 1px solid var(--exam-line, #252b25);
  border-radius: 4px;
  padding: 8px 14px;
  line-height: 1.6;
}
.exam-blink {
  animation: exam-blink 1s step-end infinite;
}
@keyframes exam-blink {
  0%, 100% { opacity: 1; }
  50% { opacity: 0; }
}

/* ── Exam ended overlay ──────────────────────────────────── */
.exam-ended-overlay {
  display: none;
  position: absolute;
  inset: 0;
  background: rgba(0,0,0,0.7);
  z-index: 50;
  align-items: center;
  justify-content: center;
}
.exam-ended-overlay.active { display: flex; }
.exam-ended-msg {
  font-family: 'JetBrains Mono', monospace;
  font-size: 14px;
  color: var(--red);
  background: var(--bg2);
  border: 1px solid var(--red);
  border-radius: 6px;
  padding: 12px 24px;
}

/* ── Export panel ────────────────────────────────────────── */
.exam-export-panel {
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.exam-export-sort-row {
  display: flex;
  gap: 6px;
  margin-bottom: 4px;
}
.exam-sort-btn {
  flex: 1;
  padding: 6px 10px;
  font-size: 11px;
  background: var(--bg4);
  border: 1px solid var(--border2);
  border-radius: 3px;
  color: var(--text2);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  transition: all .1s;
}
.exam-sort-btn:hover { background: var(--hl2); color: var(--text); }
.exam-sort-btn.active {
  background: rgba(22, 130, 93, 0.15);
  border-color: var(--green2);
  color: var(--green2);
}

/* ── Misc ────────────────────────────────────────────────── */
.exam-section-title {
  font-size: 24px;
  font-weight: 800;
  color: var(--text);
  text-align: center;
  margin-bottom: 4px;
}
.exam-section-sub {
  font-size: 13px;
  color: var(--text3);
  text-align: center;
  font-family: 'JetBrains Mono', monospace;
}
.exam-error-msg {
  font-size: 11px;
  color: var(--red);
  font-family: 'JetBrains Mono', monospace;
  padding: 6px 10px;
  background: rgba(218, 54, 51, 0.1);
  border: 1px solid rgba(218, 54, 51, 0.3);
  border-radius: 4px;
}
.exam-info-msg {
  font-size: 11px;
  color: var(--green2);
  font-family: 'JetBrains Mono', monospace;
  padding: 6px 10px;
  background: rgba(22, 130, 93, 0.1);
  border: 1px solid rgba(22, 130, 93, 0.3);
  border-radius: 4px;
}
.exam-toolbar {
  height: 35px;
  background: var(--bg3);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  padding: 0 12px;
  gap: 8px;
  flex-shrink: 0;
}
.exam-editor-wrap {
  flex: 1;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}
.exam-num-input {
  width: 70px;
  padding: 6px 8px;
  background: var(--bg);
  border: 1px solid var(--border2);
  border-radius: 3px;
  color: var(--text);
  font-family: 'JetBrains Mono', monospace;
  font-size: 13px;
  text-align: center;
  outline: none;
}
.exam-num-input:focus { border-color: var(--green2); }

/* ── Mini CodeMirror Editor Dark Theme Override ──────────── */
.exam-mini-editor .CodeMirror {
  min-height: 110px !important;
  background: #0d1117 !important;
  color: #c9d1d9 !important;
  border: 1px solid var(--border) !important;
  border-radius: 4px;
  font-family: 'JetBrains Mono', monospace !important;
  font-size: 12px !important;
}
.exam-mini-editor .CodeMirror-gutters {
  background: #161b22 !important;
  border-right: 1px solid var(--border) !important;
}
.exam-mini-editor .CodeMirror-cursor {
  border-left: 2px solid var(--green2) !important;
}
.exam-mini-editor .CodeMirror-selected {
  background: rgba(56, 139, 253, 0.25) !important;
}

/* SQL question editors use the same compact, numbered editor surface for
   mentor solutions and student answers. */
.exam-sql-editor .CodeMirror,
.exam-sql-editor-wrap .CodeMirror {
  min-height: 110px !important;
  background: #1e1e1e !important;
  color: #d4d4d4 !important;
  border: 1px solid var(--border) !important;
  font-family: 'JetBrains Mono', monospace !important;
  font-size: 12px !important;
}
.exam-sql-editor .CodeMirror-gutters,
.exam-sql-editor-wrap .CodeMirror-gutters {
  background: #1e1e1e !important;
  border-right: 1px solid #2d2d2d !important;
}
.exam-sql-editor .CodeMirror-linenumber,
.exam-sql-editor-wrap .CodeMirror-linenumber {
  color: #858585 !important;
}
.exam-sql-editor .CodeMirror-cursor,
.exam-sql-editor-wrap .CodeMirror-cursor {
  border-left-color: var(--cyan) !important;
}

/* ── Warning Notice Bar ──────────────────────────────────── */
.exam-notice-bar {
  background: rgba(218, 54, 51, 0.15);
  border-bottom: 1px solid rgba(218, 54, 51, 0.4);
  color: #ff7b72;
  font-family: 'JetBrains Mono', monospace;
  font-size: 11px;
  font-weight: 600;
  padding: 5px 12px;
  display: flex;
  align-items: center;
  gap: 8px;
  justify-content: center;
  flex-shrink: 0;
  position: relative;
}
.exam-notice-close {
  background: transparent;
  border: none;
  color: #ff7b72;
  font-size: 16px;
  font-weight: 700;
  cursor: pointer;
  position: absolute;
  right: 12px;
  padding: 0 6px;
  line-height: 1;
  opacity: 0.8;
  transition: opacity 0.15s, transform 0.15s;
}
.exam-notice-close:hover {
  opacity: 1;
  transform: scale(1.15);
}

/* ── Panel Drag Resizers ────────────────────────────────── */
.exam-resizer-v {
  width: 6px;
  background: var(--border);
  cursor: col-resize;
  flex-shrink: 0;
  position: relative;
  z-index: 10;
  transition: background 0.15s;
}
.exam-resizer-v:hover,
.exam-resizer-v.dragging {
  background: var(--green2);
  box-shadow: 0 0 8px rgba(78, 201, 176, 0.4);
}

.exam-resizer-h {
  height: 3px;
  background: var(--border);
  cursor: row-resize;
  pointer-events: auto;
  touch-action: none;
  flex-shrink: 0;
  position: relative;
  z-index: 10;
  transition: background 0.15s;
}
.exam-resizer-h:hover,
.exam-resizer-h.dragging {
  background: var(--green2);
  box-shadow: 0 0 8px rgba(78, 201, 176, 0.4);
}

.exam-resizer-v-sub {
  width: 6px;
  background: var(--border);
  cursor: col-resize;
  flex-shrink: 0;
  position: relative;
  z-index: 10;
  transition: background 0.15s;
}
.exam-resizer-v-sub:hover,
.exam-resizer-v-sub.dragging {
  background: var(--cyan);
  box-shadow: 0 0 8px rgba(0, 220, 255, 0.4);
}

/* ═══════════════════════════════════════════════════════════════
   ADVANCED WORKSPACE TABS & MARKDOWN Description Pane
   ═══════════════════════════════════════════════════════════════ */

.workspace-tab {
  height: 35px;
  background: var(--bg2);
  padding: 0 16px;
  color: var(--text3);
  cursor: pointer;
  border-right: 1px solid var(--border);
  font-family: inherit;
  font-size: 12px;
  display: flex;
  align-items: center;
  gap: 6px;
  user-select: none;
  border-top: 2px solid transparent;
  transition: background 0.15s, color 0.15s;
}

.workspace-tab:hover {
  background: #1e1e1e;
  color: var(--text);
}

.workspace-tab.active {
  background: var(--bg);
  color: #ffffff;
  border-top-color: var(--blue);
}

.workspace-pane {
  display: none;
  flex-direction: column;
  flex: 1;
  overflow: hidden;
}

.workspace-pane.active {
  display: flex;
}

/* Markdown Rendering Custom Styles */
.markdown-body {
  font-size: 13px;
  line-height: 1.6;
  color: var(--text);
}

.markdown-body h1, .markdown-body h2, .markdown-body h3 {
  color: #ffffff;
  margin-top: 14px;
  margin-bottom: 8px;
  font-weight: 600;
}

.markdown-body h1 { font-size: 1.4em; border-bottom: 1px solid var(--border); padding-bottom: 4px; }
.markdown-body h2 { font-size: 1.2em; }
.markdown-body h3 { font-size: 1.1em; }

.markdown-body p {
  margin-bottom: 12px;
}

.markdown-body ul, .markdown-body ol {
  margin-left: 20px;
  margin-bottom: 12px;
}

.markdown-body li {
  margin-bottom: 4px;
}

.markdown-body code {
  font-family: 'JetBrains Mono', monospace;
  background: var(--bg3);
  padding: 2px 5px;
  border-radius: 3px;
  font-size: 11px;
  color: var(--orange);
}

.markdown-body pre {
  background: var(--bg3);
  padding: 12px;
  border-radius: 4px;
  border: 1px solid var(--border);
  overflow-x: auto;
  margin-bottom: 12px;
}

.markdown-body pre code {
  background: none;
  padding: 0;
  color: var(--text);
  font-size: 11px;
}

/* MCQ Options overrides */
.exam-mcq-option-text p {
  margin: 0;
  display: inline;
}

.exam-mcq-option-text pre {
  background: var(--bg);
  border: 1px solid var(--border);
  padding: 8px;
  border-radius: 4px;
  margin: 4px 0;
  display: block;
}

.exam-mcq-option-text pre code {
  color: var(--text2);
}

/* Checkbox specific styles */
.exam-mcq-option-item {
  transition: background 0.15s, border-color 0.15s;
}

.exam-mcq-option-item.selected {
  background: rgba(0, 122, 204, 0.08);
  border-color: var(--blue);
}

/* Coding config panels */
.mentor-lang-checkboxes {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  margin: 6px 0;
}

.mentor-lang-checkboxes label {
  display: flex;
  align-items: center;
  gap: 4px;
  cursor: pointer;
  font-size: 12px;
}

/* README active panel - expands to take full screen height */
.exam-question-display.workspace-readme-active {
  flex: 1 !important;
  max-height: none !important;
  border-bottom: none !important;
  border-left: none !important;
  overflow-y: auto !important;
  background: var(--bg2) !important;
}

/* Markdown pre code overrides - resets general code styling inside blocks */
.markdown-body pre code {
  background: transparent !important;
  padding: 0 !important;
  color: var(--text) !important;
  font-family: 'JetBrains Mono', monospace !important;
  font-size: 12px !important;
  border-radius: 0 !important;
}

/* Student CodeMirror wrapper and scrollable area styling */
.exam-editor-wrap .CodeMirror {
  height: 100% !important;
  display: flex !important;
  flex-direction: column !important;
}

.exam-editor-wrap .CodeMirror-scroll {
  flex: 1 !important;
  height: 100% !important;
}

/* LeetCode Style Console Tab Bar Item */
.console-tabbar-item {
  display: flex;
  align-items: center;
  padding: 0 12px;
  height: 100%;
  font-size: 11px;
  color: var(--text3);
  cursor: pointer;
  border-bottom: 2px solid transparent;
  transition: all 0.15s;
  font-weight: 500;
  font-family: 'Inter', sans-serif;
}

.console-tabbar-item:hover {
  color: var(--text2);
  background: rgba(255, 255, 255, 0.01);
}

.console-tabbar-item.active {
  color: var(--cyan);
  border-bottom-color: var(--cyan);
  background: rgba(255, 255, 255, 0.02);
  font-weight: 600;
}

/* Custom CodeMirror Editor Themes */

/* Default/Classic Dark Theme */
.CodeMirror.cm-theme-default {
  background: var(--bg2) !important;
  color: var(--text) !important;
  font-family: 'JetBrains Mono', monospace;
}
.CodeMirror.cm-theme-default .CodeMirror-gutters {
  background: var(--bg3) !important;
  border-right: 1px solid var(--border) !important;
}
.CodeMirror.cm-theme-default .CodeMirror-linenumber {
  color: var(--text3) !important;
}
.CodeMirror.cm-theme-default .CodeMirror-cursor {
  border-left: 2px solid var(--cyan) !important;
}
.CodeMirror.cm-theme-default .cm-keyword { color: #f43f5e !important; font-weight: bold; }
.CodeMirror.cm-theme-default .cm-comment { color: #6b7280 !important; font-style: italic; }
.CodeMirror.cm-theme-default .cm-string { color: #10b981 !important; }
.CodeMirror.cm-theme-default .cm-number { color: #f59e0b !important; }
.CodeMirror.cm-theme-default .cm-variable { color: #e2e8f0 !important; }
.CodeMirror.cm-theme-default .cm-def { color: #38bdf8 !important; }
.CodeMirror.cm-theme-default .cm-operator { color: #f43f5e !important; }

/* Cyberpunk Neon Theme */
.CodeMirror.cm-theme-cyberpunk {
  background: #0f051d !important;
  color: #00ffcc !important;
  font-family: 'Fira Code', 'JetBrains Mono', monospace;
}
.CodeMirror.cm-theme-cyberpunk .CodeMirror-gutters {
  background: #140b24 !important;
  border-right: 1px solid #ff007f !important;
}
.CodeMirror.cm-theme-cyberpunk .CodeMirror-linenumber {
  color: #ff007f !important;
}
.CodeMirror.cm-theme-cyberpunk .CodeMirror-cursor {
  border-left: 2px solid #ff007f !important;
}
.CodeMirror.cm-theme-cyberpunk .cm-keyword { color: #ff007f !important; font-weight: bold; text-shadow: 0 0 5px #ff007f; }
.CodeMirror.cm-theme-cyberpunk .cm-comment { color: #725e9c !important; font-style: italic; }
.CodeMirror.cm-theme-cyberpunk .cm-string { color: #ffff00 !important; text-shadow: 0 0 5px #ffff00; }
.CodeMirror.cm-theme-cyberpunk .cm-number { color: #00ffff !important; text-shadow: 0 0 5px #00ffff; }
.CodeMirror.cm-theme-cyberpunk .cm-variable { color: #00ffcc !important; }
.CodeMirror.cm-theme-cyberpunk .cm-def { color: #bd00ff !important; text-shadow: 0 0 5px #bd00ff; }
.CodeMirror.cm-theme-cyberpunk .cm-operator { color: #ff007f !important; }

/* Monokai Warm Theme */
.CodeMirror.cm-theme-monokai {
  background: #272822 !important;
  color: #f8f8f2 !important;
  font-family: 'Courier New', monospace;
}
.CodeMirror.cm-theme-monokai .CodeMirror-gutters {
  background: #1e1f1c !important;
  border-right: 1px solid #272822 !important;
}
.CodeMirror.cm-theme-monokai .CodeMirror-linenumber {
  color: #75715e !important;
}
.CodeMirror.cm-theme-monokai .CodeMirror-cursor {
  border-left: 2px solid #f8f8f0 !important;
}
.CodeMirror.cm-theme-monokai .cm-keyword { color: #f92672 !important; font-weight: bold; }
.CodeMirror.cm-theme-monokai .cm-comment { color: #75715e !important; font-style: italic; }
.CodeMirror.cm-theme-monokai .cm-string { color: #e6db74 !important; }
.CodeMirror.cm-theme-monokai .cm-number { color: #ae81ff !important; }
.CodeMirror.cm-theme-monokai .cm-variable { color: #a6e22e !important; }
.CodeMirror.cm-theme-monokai .cm-def { color: #66d9ef !important; }

/* Glass Frost (Glassmorphism) Theme */
.CodeMirror.cm-theme-glass {
  background: rgba(30, 41, 59, 0.7) !important;
  backdrop-filter: blur(10px);
  color: #e2e8f0 !important;
  font-family: 'JetBrains Mono', monospace;
}
.CodeMirror.cm-theme-glass .CodeMirror-gutters {
  background: rgba(15, 23, 42, 0.4) !important;
  border-right: 1px solid rgba(255, 255, 255, 0.08) !important;
}
.CodeMirror.cm-theme-glass .CodeMirror-linenumber {
  color: #94a3b8 !important;
}
.CodeMirror.cm-theme-glass .CodeMirror-cursor {
  border-left: 2px solid #38bdf8 !important;
}
.CodeMirror.cm-theme-glass .cm-keyword { color: #818cf8 !important; font-weight: bold; }
.CodeMirror.cm-theme-glass .cm-comment { color: #64748b !important; font-style: italic; }
.CodeMirror.cm-theme-glass .cm-string { color: #34d399 !important; }
.CodeMirror.cm-theme-glass .cm-number { color: #fb7185 !important; }
.CodeMirror.cm-theme-glass .cm-def { color: #38bdf8 !important; }

/* LeetCode Dark Theme Override for Default */
.CodeMirror.cm-theme-default {
  background: #1e1e1e !important;
  color: #d4d4d4 !important;
}
.CodeMirror.cm-theme-default .CodeMirror-gutters {
  background: #1e1e1e !important;
  border-right: 1px solid #2d2d2d !important;
}
.CodeMirror.cm-theme-default .CodeMirror-linenumber {
  color: #858585 !important;
}
.CodeMirror.cm-theme-default .CodeMirror-cursor {
  border-left: 2px solid #c6c6c6 !important;
}
.CodeMirror.cm-theme-default .CodeMirror-activeline-background {
  background: rgba(255, 255, 255, 0.03) !important;
}
.CodeMirror.cm-theme-default .cm-keyword { color: #569cd6 !important; font-weight: bold; }
.CodeMirror.cm-theme-default .cm-comment { color: #6a9955 !important; font-style: italic; }
.CodeMirror.cm-theme-default .cm-string { color: #ce9178 !important; }
.CodeMirror.cm-theme-default .cm-number { color: #b5cea8 !important; }
.CodeMirror.cm-theme-default .cm-variable { color: #9cdcfe !important; }
.CodeMirror.cm-theme-default .cm-def { color: #dcdcaa !important; }
.CodeMirror.cm-theme-default .cm-operator { color: #d4d4d4 !important; }
.CodeMirror.cm-theme-default .cm-type { color: #4ec9b0 !important; }

/* Student editor customization overrides to allow font-size & family inheritance */
.exam-editor-wrap .CodeMirror,
.exam-editor-wrap .CodeMirror pre.CodeMirror-line,
.exam-editor-wrap .CodeMirror-linenumber,
.exam-editor-wrap .CodeMirror-code pre,
.exam-editor-wrap .CodeMirror-line span {
  font-family: inherit !important;
  font-size: inherit !important;
  line-height: 1.5 !important;
}

/* Unified Playground Terminal Custom styling */
#terminal-view {
  border-top: 1px solid var(--border);
}
#terminal-view.codexa-terminal {
  background: #171717;
  color: #d4d4d4;
}
.terminal-session-output {
  flex: 1;
  min-height: 0;
  overflow: auto;
  padding: 12px 16px 8px;
  font: 12px/1.6 'JetBrains Mono', 'Consolas', monospace;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  scrollbar-width: thin;
  scrollbar-color: #454545 transparent;
}
.terminal-welcome { color: var(--text3); }
.terminal-entry { margin: 0 0 10px; }
.terminal-entry-command { color: #dcdcaa; }
.terminal-entry-command::before { content: '› '; color: #4daaf2; }
.terminal-entry-output,
.terminal-entry-error { padding-left: 18px; }
.terminal-entry-output { color: #d4d4d4; }
.terminal-entry-error { color: #f48771; }
.terminal-input-row {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  padding: 8px 16px 10px;
  background: #171717;
}
.terminal-prompt { color: #4daaf2; font: 14px/1.6 'JetBrains Mono', monospace; }
.terminal-input-row textarea {
  flex: 1;
  min-height: 22px;
  max-height: 110px;
  resize: none;
  overflow-y: auto;
  border: 0;
  outline: 0;
  padding: 2px 0;
  background: transparent;
  color: #d4d4d4;
  font: 12px/1.6 'JetBrains Mono', 'Consolas', monospace;
}
.terminal-input-row textarea::placeholder { color: #777; }
/* Workspace search */
.workspace-search-toolbar { padding: 12px 10px 8px; border-bottom: 1px solid var(--border); }
.workspace-search-input-wrap { display:flex; align-items:center; gap:7px; border:1px solid var(--border2); border-radius:4px; background:var(--bg2); padding:0 7px; }
.workspace-search-icon { color:var(--text3); font-size:18px; line-height:1; }
.workspace-search-input-wrap input { flex:1; min-width:0; border:0; outline:0; background:transparent; color:var(--text); padding:8px 0; font-size:12px; }
.workspace-search-options { display:flex; align-items:center; gap:9px; margin-top:9px; color:var(--text3); font-size:10px; flex-wrap:wrap; }
.workspace-search-options select { border:1px solid var(--border2); background:var(--bg); color:var(--text2); border-radius:3px; padding:3px 4px; font-size:10px; }
.workspace-search-options label { display:flex; align-items:center; gap:4px; white-space:nowrap; }
.workspace-search-options input { accent-color:#4daaf2; }
.workspace-search-status { padding:9px 12px 5px; color:var(--text3); font-size:10px; }
.workspace-search-results { overflow:auto; padding:0 6px 10px; }
.workspace-search-result { display:flex; width:100%; gap:8px; padding:8px 7px; text-align:left; border:0; border-bottom:1px solid rgba(255,255,255,.04); background:transparent; color:var(--text2); cursor:pointer; }
.workspace-search-result:hover { background:rgba(77,170,242,.12); }
.workspace-search-result-icon { color:#7fbbe4; width:14px; flex:none; }
.workspace-search-result-main { min-width:0; display:flex; flex-direction:column; gap:2px; }
.workspace-search-result-path { overflow:hidden; text-overflow:ellipsis; white-space:nowrap; color:var(--text); font-size:11px; }
.workspace-search-result-meta { color:var(--text3); font-size:10px; }
.workspace-search-result-snippet { overflow:hidden; text-overflow:ellipsis; white-space:nowrap; color:#9b9b9b; font:10px/1.4 'JetBrains Mono', monospace; }
.workspace-search-empty { padding:18px 10px; color:var(--text3); font-size:11px; text-align:center; }
.workspace-search-empty.search-error { color:var(--red); }

/* ═══════════════════════════════════════════════════════════════════════
   EXAM WORKSPACE — focused assessment shell
   Inspired by modern online-assessment layouts: problem context stays
   visible beside the editor, while navigation and submission remain fixed.
════════════════════════════════════════════════════════════════════════ */
#exam-student-exam-panel {
  --exam-surface: #111411;
  --exam-surface-2: #151915;
  --exam-line: #252b25;
  --exam-muted: #7d877d;
  --exam-accent: #b8d86f;
  background: #0c0f0c;
}
#exam-student-exam-panel .exam-topbar {
  height: 52px;
  padding: 0 18px;
  background: #101410;
  border-bottom: 1px solid var(--exam-line);
  gap: 10px;
}
#exam-student-exam-panel .exam-brand-mark {
  display: grid;
  place-items: center;
  width: 25px;
  height: 25px;
  border-radius: 5px;
  background: var(--exam-accent);
  color: #172012;
  font-size: 11px;
}
#exam-student-exam-panel .exam-topbar-title {
  color: #e3e8e1;
  font: 600 13px/1 'Segoe UI', system-ui, sans-serif;
}
.exam-topbar-context { color: var(--exam-muted); font-size: 11px; }
.exam-topbar-progress,
.exam-save-state { color: var(--exam-muted); font: 11px 'JetBrains Mono', monospace; }
.exam-save-state { color: #a8c87a; }
#exam-student-exam-panel .exam-status-chip {
  border-color: rgba(184,216,111,.3);
  color: var(--exam-accent);
  background: rgba(184,216,111,.08);
}
#exam-student-exam-panel .exam-btn-red {
  background: transparent;
  border-color: #4b5548;
  color: #d0d8cc;
}
.exam-progress-track { height: 2px; background: #202720; flex-shrink: 0; }
.exam-progress-track > div { height: 100%; width: 0; background: var(--exam-accent); transition: width .2s ease; }
#exam-student-exam-panel .exam-notice-bar {
  min-height: 30px;
  padding: 6px 18px;
  color: #a4aea2;
  background: #121712;
  border-bottom: 1px solid var(--exam-line);
  font-size: 11px;
}
#exam-student-exam-panel .exam-student-shell { background: #0c0f0c; }
#exam-student-exam-panel .exam-qnav {
  width: 188px;
  background: #101310;
  border-right-color: var(--exam-line);
}
#exam-student-exam-panel .exam-qnav-hdr {
  height: 46px;
  padding: 0 16px;
  justify-content: space-between;
  color: #cfd7ce;
  text-transform: none;
  letter-spacing: 0;
  font-size: 12px;
}
.exam-qnav-count { color: var(--exam-muted); font: 11px 'JetBrains Mono', monospace; }
#exam-student-exam-panel .exam-qnav-card {
  margin: 4px 7px;
  padding: 10px 9px;
  border: 1px solid transparent;
  border-radius: 5px;
}
#exam-student-exam-panel .exam-qnav-card:hover { background: #192019; }
#exam-student-exam-panel .exam-qnav-card.active {
  background: rgba(184,216,111,.09);
  border-color: rgba(184,216,111,.26);
  border-left: 2px solid var(--exam-accent);
}
#exam-student-exam-panel .exam-q-num { color: #d5ddd4; font-size: 10px; }
#exam-student-exam-panel .exam-q-type-chip { opacity: .78; }
#exam-student-exam-panel .exam-student-main {
  display: grid;
  grid-template-columns: minmax(300px, .88fr) minmax(430px, 1.12fr);
  grid-template-rows: minmax(0, 1fr);
  background: #0c0f0c;
}
#exam-student-exam-panel .exam-question-display {
  grid-column: 1;
  grid-row: 1;
  min-width: 0;
  max-height: none;
  height: 100%;
  padding: 28px 30px;
  overflow-y: auto;
  background: var(--exam-surface);
  border-right: 1px solid var(--exam-line);
  border-bottom: 0;
  border-left: 0;
}
#exam-student-exam-panel .exam-question-header {
  padding-bottom: 14px;
  margin-bottom: 22px;
  border-bottom: 1px solid var(--exam-line);
}
#exam-student-exam-panel .exam-question-number { color: #dce4da; font-size: 13px; }
#exam-student-exam-panel .exam-question-marks { color: var(--exam-accent); }
#exam-student-exam-panel .exam-question-text { color: #b9c2b8; font-size: 13px; line-height: 1.65; }
#exam-student-exam-panel .exam-question-text h1,
#exam-student-exam-panel .exam-question-text h2,
#exam-student-exam-panel .exam-question-text h3 { color: #e4e9e2; letter-spacing: -.01em; }
#exam-student-exam-panel #student-query-area {
  grid-column: 2;
  grid-row: 1;
  min-width: 0;
  min-height: 0;
  background: #101310;
}
#exam-student-exam-panel .exam-toolbar {
  min-height: 46px;
  padding: 0 12px;
  background: var(--exam-surface-2);
  border-bottom: 1px solid var(--exam-line);
}
#exam-student-exam-panel .exam-editor-wrap { min-height: 0; background: #101310; }
#exam-student-exam-panel .exam-student-console {
  height: 220px;
  flex: 0 0 auto;
  background: #0e110e;
  border-top-color: var(--exam-line);
}
#exam-student-exam-panel .exam-console-hdr,
#exam-student-exam-panel #student-console-panes-box,
#exam-student-exam-panel #box-pane-left,
#exam-student-exam-panel #box-pane-right { background: var(--exam-surface-2) !important; }
#exam-student-exam-panel .exam-console-hdr { border-bottom-color: var(--exam-line); }
#exam-student-exam-panel #student-console-title-text { color: #d4ddd2 !important; text-transform: none !important; letter-spacing: 0 !important; }
#exam-student-exam-panel #student-pane-left-title,
#exam-student-exam-panel #student-pane-right-title { color: var(--exam-muted) !important; background: #111511 !important; border-color: var(--exam-line) !important; }
#exam-student-exam-panel .exam-student-footer {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 54px;
  padding: 0 16px;
  background: #101410;
  border-top: 1px solid var(--exam-line);
}
.exam-footer-btn,
.exam-footer-submit {
  border: 1px solid #303930;
  border-radius: 4px;
  background: #171c17;
  color: #c0c9be;
  padding: 7px 12px;
  cursor: pointer;
  font-size: 11px;
}
.exam-footer-btn:hover:not(:disabled) { border-color: #64735c; background: #202820; }
.exam-footer-btn:disabled { opacity: .35; cursor: default; }
.exam-footer-progress { color: var(--exam-muted); font: 11px 'JetBrains Mono', monospace; margin: 0 auto; }
.exam-footer-submit { border-color: rgba(184,216,111,.45); background: var(--exam-accent); color: #182014; font-weight: 700; }
.exam-footer-submit:hover { filter: brightness(1.08); }
#exam-student-exam-panel #student-mcq-area { grid-column: 1 / -1; }
#exam-student-exam-panel #student-no-q-selected { grid-column: 1 / -1; }

/* Premium assessment workspace — calm, information-dense, and keyboard-first. */
#exam-student-exam-panel {
  background: #0b0e0b;
  color-scheme: dark;
}
#exam-student-exam-panel .exam-topbar {
  height: 58px;
  padding: 0 22px;
  background: #111511;
  box-shadow: 0 1px 0 rgba(255,255,255,.025);
}
#exam-student-exam-panel .exam-brand-mark {
  width: 28px;
  height: 28px;
  border-radius: 6px;
  box-shadow: 0 0 0 4px rgba(184,216,111,.06);
}
.exam-brand-copy { display:flex; flex-direction:column; gap:4px; min-width:180px; }
#exam-student-exam-panel .exam-topbar-title { font-size:13px; letter-spacing:.01em; }
#exam-student-exam-panel .exam-topbar-context { font-size:10px; color:#768175; }
#exam-student-exam-panel .exam-topbar-progress {
  padding:5px 9px;
  border:1px solid #293329;
  border-radius:4px;
  background:#151b15;
  color:#b9c5b5;
}
#exam-student-exam-panel .exam-save-state { padding-right:10px; border-right:1px solid #293329; }
.exam-session-strip {
  display:flex;
  align-items:center;
  gap:28px;
  min-height:42px;
  padding:0 22px;
  background:#0f130f;
  border-bottom:1px solid var(--exam-line);
  color:#778277;
  font-size:11px;
}
.exam-session-step { display:flex; align-items:center; gap:8px; height:42px; position:relative; }
.exam-session-step.active { color:#d8e0d5; }
.exam-session-step.active::after { content:''; position:absolute; left:0; right:0; bottom:-1px; height:2px; background:var(--exam-accent); }
.exam-session-index { display:grid; place-items:center; width:17px; height:17px; border:1px solid #354035; border-radius:4px; font:10px 'JetBrains Mono',monospace; }
.exam-session-step.active .exam-session-index { background:rgba(184,216,111,.12); border-color:rgba(184,216,111,.5); color:var(--exam-accent); }
.exam-session-check { color:var(--exam-accent); font-size:12px; }
.exam-focus-mode { margin-left:auto; color:#8c978b; display:flex; align-items:center; gap:7px; }
.exam-focus-glyph { font-size:15px; color:#b4c2af; }
#exam-student-exam-panel .exam-notice-bar { min-height:28px; padding:5px 22px; background:#121712; }
#exam-student-exam-panel .exam-student-shell { min-height:0; }
#exam-student-exam-panel .exam-qnav { width:205px; background:#101410; }
#exam-student-exam-panel .exam-qnav-hdr { height:50px; padding:0 17px; font-weight:600; border-bottom-color:#293329; }
#exam-student-exam-panel .exam-qnav-body { padding:7px 0; }
#exam-student-exam-panel .exam-qnav-card { margin:3px 9px; padding:11px 10px; border-radius:5px; }
#exam-student-exam-panel .exam-qnav-card.active { box-shadow:inset 0 0 0 1px rgba(184,216,111,.14); }
#exam-student-exam-panel .exam-qnav-card .exam-q-preview { color:#7d897c; }
#exam-student-exam-panel .exam-student-main { grid-template-columns:minmax(360px,.9fr) minmax(520px,1.1fr); gap:0; }
#exam-student-exam-panel .exam-question-display { padding:30px 32px; background:#111511; }
#exam-student-exam-panel .exam-question-header { margin-bottom:24px; padding-bottom:16px; }
#exam-student-exam-panel .exam-question-text { max-width:640px; font-size:13px; color:#b9c2b8; }
#exam-student-exam-panel .exam-question-text p { margin:0 0 14px; }
#exam-student-exam-panel .exam-question-text pre,
#exam-student-exam-panel .exam-question-text code { background:#171d17; border:1px solid #222b22; border-radius:4px; }
#exam-student-exam-panel .exam-question-text pre { padding:14px; overflow:auto; }
#exam-student-exam-panel #student-query-area { background:#0f130f; }
#exam-student-exam-panel .exam-toolbar { height:46px; min-height:46px; padding:0 13px; background:#151b15; }
#exam-student-exam-panel .exam-editor-wrap { background:#101410; }
#exam-student-exam-panel .exam-student-console { height:228px; flex:0 0 auto; background:#0d110d; }
#exam-student-exam-panel .exam-console-hdr { height:38px !important; background:#151b15 !important; padding:0 14px !important; }
#exam-student-exam-panel #student-console-tabs-bar { align-items:center; }
#exam-student-exam-panel #student-console-tabs-bar > * { padding:6px 10px; border:1px solid transparent; border-radius:4px; }
#exam-student-exam-panel #student-console-tabs-bar > *.active { color:#dce7d8; background:#1b241b; border-color:#344334; }
#exam-student-exam-panel #student-console-panes-box { background:#202820 !important; gap:1px; }
#exam-student-exam-panel #box-pane-left,
#exam-student-exam-panel #box-pane-right { background:#101410 !important; }
#exam-student-exam-panel #student-pane-left-title,
#exam-student-exam-panel #student-pane-right-title { padding:7px 12px; background:#151b15 !important; }
#exam-student-exam-panel .exam-student-footer { min-height:58px; padding:0 22px; background:#111511; }
#exam-student-exam-panel .exam-footer-btn { min-width:92px; }
#exam-student-exam-panel .exam-footer-submit { min-width:130px; padding:9px 14px; }

/* The mentor, join, and waiting screens share the assessment workspace palette
   so the whole exam flow reads as one product. */
#exam-mentor-dash-panel,
#exam-student-join-panel,
#exam-student-wait-panel {
  --exam-surface: #111411;
  --exam-surface-2: #151915;
  --exam-line: #252b25;
  --exam-muted: #7d877d;
  --exam-accent: #b8d86f;
}

/* Bring mentor, join, and waiting screens into the same product system. */
#exam-mentor-dash-panel .exam-topbar,
#exam-student-join-panel .exam-topbar,
#exam-student-wait-panel .exam-topbar { height:54px; background:#111511; border-bottom-color:#293329; }
#exam-mentor-dash-panel .exam-notice-bar,
#exam-student-wait-panel .exam-notice-bar { background:#121712; }
#exam-mentor-dash-panel .exam-dash-shell { background:#0b0e0b; }
#exam-mentor-dash-panel .exam-dash-left,
#exam-mentor-dash-panel .exam-dash-right { background:#101410; border-color:#293329; }
#exam-mentor-dash-panel .exam-dash-main { background:#0f130f; }
#exam-mentor-dash-panel .exam-tabbar { background:#111511; border-color:#293329; }
#exam-mentor-dash-panel .exam-tab.active { color:var(--exam-accent); border-bottom-color:var(--exam-accent); }
#exam-student-join-panel .exam-form-card,
#exam-student-wait-panel .exam-wait-content { box-shadow:0 18px 55px rgba(0,0,0,.22); }
#exam-student-join-panel .exam-form-title,
#exam-student-wait-panel .exam-wait-title { letter-spacing:-.02em; }

@media (max-width: 900px) {
  #exam-student-exam-panel .exam-qnav { width: 148px; }
  #exam-student-exam-panel .exam-student-main { grid-template-columns: minmax(250px, .8fr) minmax(360px, 1.2fr); }
  #exam-student-exam-panel .exam-question-display { padding: 20px; }
  .exam-topbar-context { display: none; }
  .exam-session-strip { gap:14px; padding:0 14px; }
}
@media (max-width: 700px) {
  #exam-student-exam-panel .exam-qnav { display: none; }
  #exam-student-exam-panel .exam-student-main { display: flex; }
  #exam-student-exam-panel .exam-question-display { max-height: 38%; height: auto; border-right: 0; border-bottom: 1px solid var(--exam-line); }
  #exam-student-exam-panel #student-query-area { min-height: 0; }
  #exam-student-exam-panel .exam-save-state { display: none; }
  .exam-session-strip { min-height:36px; gap:10px; font-size:10px; overflow:auto; }
  .exam-session-step { height:36px; white-space:nowrap; }
  .exam-session-step:nth-child(3), .exam-focus-mode { display:none; }
}

/* ── Exam refinement: compact navigator, collapsible mentor context, and
   accessible editor controls ─────────────────────────────────────────── */
.exam-room-copy-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 30px;
  padding: 0 10px;
  border: 1px solid #303830;
  border-radius: 6px;
  background: #151a15;
  color: #d8e1d6;
  font: 600 11px 'JetBrains Mono', monospace;
  cursor: pointer;
}
.exam-shared-brand-mark {
  display: grid;
  place-items: center;
  width: 25px;
  height: 25px;
  flex: 0 0 25px;
  border-radius: 6px;
  background: var(--exam-accent, #b8d86f);
  color: #172012;
}
.exam-room-copy-pill:hover,
.exam-room-copy-pill:focus-visible { border-color: var(--exam-accent, #b8d86f); color: var(--exam-accent, #b8d86f); outline: none; }
.exam-room-copy-pill svg { display: block; flex: 0 0 auto; }
.exam-participants-toggle { gap: 7px; }
.exam-participants-toggle.active { color: var(--exam-accent, #b8d86f); border-color: rgba(184,216,111,.45); background: rgba(184,216,111,.08); }
.exam-question-summary { margin-left: 8px; color: var(--exam-muted, #7d877d); font: 11px 'JetBrains Mono', monospace; }

#exam-mentor-dash-panel .exam-dash-left { display: none; }
#exam-mentor-dash-panel #resizer-mentor-left { display: none; }
#exam-mentor-dash-panel .exam-dash-main { flex: 1; min-width: 0; }
#exam-mentor-dash-panel .exam-dash-right { min-width: 260px; }
.exam-flag-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  min-width: 34px;
  padding: 4px 7px;
  border-radius: 999px;
  font: 600 11px 'JetBrains Mono', monospace;
  cursor: pointer;
}
.exam-flag-badge.is-clear { color: #93a091; border: 1px solid #344034; background: #151b15; }
.exam-flag-badge.is-flagged { color: #e7b866; border: 1px solid rgba(231,184,102,.4); background: rgba(231,184,102,.1); }
.exam-flag-badge:hover { filter: brightness(1.15); }
.exam-proctor-summary { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; width: 100%; text-align: left; }
.exam-proctor-metric,
.exam-proctor-last-flag { display: flex; flex-direction: column; gap: 7px; padding: 12px 13px; border: 1px solid #373737; border-radius: 6px; background: #202020; }
.exam-proctor-metric span,
.exam-proctor-last-flag span { color: #969696; font-size: 10px; text-transform: uppercase; letter-spacing: .06em; }
.exam-proctor-metric strong { color: #e2b866; font: 700 21px 'JetBrains Mono', monospace; }
.exam-proctor-last-flag { margin-top: 10px; text-align: left; }
.exam-proctor-last-flag strong { color: #d8ddd6; font: 11px 'JetBrains Mono', monospace; }
#exam-warning-modal.exam-proctor-log-modal .modal-titlebar { background: rgba(220,182,106,.08); border-bottom-color: rgba(220,182,106,.28); }
#exam-warning-modal.exam-proctor-log-modal .modal-titlebar > svg { fill: #dcb66a; color: #dcb66a; }
.exam-submit-summary { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; width: 100%; text-align: left; }
.exam-submit-count, .exam-submit-total { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; padding: 9px 10px; border: 1px solid #334333; border-radius: 5px; background: #151b15; }
.exam-submit-count strong { color: #a8cf78; font: 700 17px 'JetBrains Mono', monospace; }
.exam-submit-count span, .exam-submit-total span { color: #8c998a; font-size: 10px; text-transform: uppercase; letter-spacing: .05em; }
.exam-query-verdict { font-weight: 700; letter-spacing: .01em; }
.exam-query-verdict.is-accepted { color: #8fd36a !important; }
.exam-query-verdict.is-wrong { color: #f27b7b !important; }
.exam-submit-count.is-pending { border-color: #4a4030; background: #1d1a14; }
.exam-submit-count.is-pending strong { color: #dcb66a; }
.exam-submit-total { grid-column: 1 / -1; background: transparent; border-color: #2a302a; }
.exam-submit-total strong { color: #d7ded4; font: 600 12px 'JetBrains Mono', monospace; }

#exam-student-exam-panel .exam-topbar { height: 48px; padding: 0 18px; }
#exam-student-exam-panel .exam-brand-mark { width: 25px; height: 25px; }
#exam-student-exam-panel .exam-icon-button {
  display: inline-grid;
  place-items: center;
  width: 30px;
  height: 30px;
  border: 1px solid #303830;
  border-radius: 5px;
  background: transparent;
  color: #9ca99b;
  cursor: pointer;
}
#exam-student-exam-panel .exam-icon-button:hover,
#exam-student-exam-panel .exam-icon-button.active { color: var(--exam-accent); border-color: rgba(184,216,111,.48); background: rgba(184,216,111,.08); }
#exam-student-exam-panel #student-focus-button { display: none !important; }
#exam-student-exam-panel .exam-qnav { width: 60px; }
#exam-student-exam-panel #resizer-student-qnav { display: none; }
#exam-student-exam-panel .exam-qnav-hdr { height: 32px; padding: 0; justify-content: center; }
#exam-student-exam-panel .exam-qnav-hdr > span:first-child { font-size: 0; }
#exam-student-exam-panel .exam-qnav-hdr > span:first-child::after { content: 'Q'; font-size: 10px; }
#exam-student-exam-panel .exam-qnav-count { font-size: 9px; }
#exam-student-exam-panel .exam-qnav-card { margin: 3px 6px; padding: 6px 4px; align-items: center; gap: 2px; border: 1px solid var(--border); border-radius: 6px; }
#exam-student-exam-panel .exam-qnav-card.active { border-left: 2px solid var(--green2); }
#exam-student-exam-panel .exam-q-card-top { flex-direction: column; gap: 6px; align-items: center; }
#exam-student-exam-panel .exam-q-card-top .exam-q-type-chip,
#exam-student-exam-panel .exam-q-card-top .exam-q-marks-badge,
#exam-student-exam-panel .exam-q-preview { display: none; }
#exam-student-exam-panel .exam-q-status-dot { margin-left: 0 !important; }
#exam-student-exam-panel .exam-student-main { width: 100%; flex: 1 1 auto; grid-template-columns: minmax(0, .9fr) 3px minmax(0, 1.1fr); }
#exam-student-exam-panel .exam-description-resizer { grid-column: 2; grid-row: 1; width: 3px; cursor: col-resize; background: #202820; border: 0; z-index: 3; pointer-events: auto; touch-action: none; }
#exam-student-exam-panel .exam-description-resizer:hover,
#exam-student-exam-panel .exam-description-resizer.dragging { background: var(--exam-accent); }
#exam-student-exam-panel .exam-description-resizer { width: 3px; }
#exam-student-exam-panel .exam-resizer-h { height: 3px; box-shadow: none; }
#exam-student-exam-panel .exam-resizer-v-sub { width: 3px; box-shadow: none; }
#exam-student-exam-panel #student-query-area { grid-column: 3; grid-row: 1; }
#exam-student-exam-panel #student-query-area { width: auto; }
#exam-student-exam-panel .exam-question-display { grid-column: 1; grid-row: 1; }
#exam-student-exam-panel #student-mcq-area { grid-column: 1 / -1; width: 100%; padding: 24px 34px !important; }
#exam-student-exam-panel #student-mcq-question-text { max-width: 1120px; }
#exam-student-exam-panel #student-mcq-options { width: min(100%, 1120px); display: grid !important; grid-template-columns: repeat(2, minmax(0, 1fr)); grid-auto-rows: minmax(52px, auto); align-content: start; gap: 9px; }
#exam-student-exam-panel #student-mcq-options .exam-mcq-option-item { min-height: 52px; padding: 12px 14px; }
#exam-student-exam-panel #student-submit-mcq-btn { display: none !important; }
#exam-student-exam-panel #student-mcq-status { color: #9ca99b !important; }
#exam-student-exam-panel #student-mcq-status::before { content: 'Autosaved'; color: #8da37e; }
#exam-student-exam-panel #student-mcq-status { font-size: 0 !important; }
#exam-student-exam-panel #student-mcq-status::before { font-size: 11px; }
#exam-student-exam-panel .exam-student-footer { min-height: 44px; height: 44px; padding: 0 12px; }
#exam-student-exam-panel .exam-footer-btn { min-width: 78px; padding: 6px 10px; font-size: 11px; }
#exam-student-exam-panel .exam-footer-submit { min-width: 116px; padding: 7px 10px; font-size: 11px; }
#exam-student-exam-panel #student-workspace-tabs { display: none !important; }
#exam-student-exam-panel.exam-focus-mode-active .exam-qnav,
#exam-student-exam-panel.exam-focus-mode-active #resizer-student-qnav,
#exam-student-exam-panel.exam-focus-mode-active .exam-notice-bar { display: none !important; }
#exam-student-exam-panel.exam-focus-mode-active .exam-student-main {
  width: 100%;
  grid-template-columns: minmax(0, 1fr);
}
#exam-student-exam-panel.exam-focus-mode-active #student-question-display,
#exam-student-exam-panel.exam-focus-mode-active .exam-description-resizer {
  display: none !important;
}
#exam-student-exam-panel.exam-focus-mode-active #student-query-area {
  grid-column: 1 / -1;
  width: 100%;
}
.exam-save-state.is-saving { color: #d8bd72 !important; }
.exam-save-state.is-dirty { color: #d8bd72 !important; }
.exam-save-state.is-error { color: #e17d77 !important; }
.exam-verdict { font-weight: 700; letter-spacing: .01em; }
.exam-verdict-accepted { color: #a8cf78; }
.exam-verdict-wrong, .exam-verdict-error { color: #e17b76; }
.exam-console-preview-label { margin-bottom: 6px; color: #a8c18f; font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; }
.exam-console-preview-value { margin: 0 0 10px; padding: 8px; border: 1px solid #2d382d; border-radius: 4px; background: #151a15; color: #d5dfd2; font: 11px/1.5 'JetBrains Mono', monospace; white-space: pre-wrap; }

#exam-student-exam-panel .CodeMirror,
#exam-student-exam-panel .CodeMirror pre,
#exam-student-exam-panel .CodeMirror-lines,
#exam-student-exam-panel .CodeMirror-code,
#exam-student-exam-panel .CodeMirror pre.CodeMirror-line,
#exam-student-exam-panel .CodeMirror pre.CodeMirror-line-like,
#exam-student-exam-panel .CodeMirror-linenumber,
#exam-student-exam-panel .CodeMirror-line span { font-family: inherit; font-size: inherit; }

@media (max-width: 900px) {
  #exam-student-exam-panel .exam-qnav { width: 54px; }
  #exam-student-exam-panel .exam-student-main { grid-template-columns: minmax(0, .8fr) 3px minmax(0, 1.2fr); }
}
@media (max-width: 700px) {
  #exam-student-exam-panel .exam-description-resizer { display: none; }
  #exam-student-exam-panel .exam-student-main { grid-template-columns: 1fr; display: flex; }
  #exam-student-exam-panel #student-query-area { grid-column: auto; }
  #exam-student-exam-panel #student-mcq-options { grid-template-columns: 1fr; }
}
#terminal-stdout {
  scrollbar-width: thin;
  scrollbar-color: #3a3a3a transparent;
  font-family: 'JetBrains Mono', 'Consolas', monospace !important;
}
#terminal-stdout::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}
#terminal-stdout::-webkit-scrollbar-thumb {
  background-color: #3a3a3a;
  border-radius: 3px;
}
#terminal-stdin-val::placeholder {
  color: #555555;
  font-style: italic;
}
#terminal-stdin-val:focus {
  color: #38bdf8 !important;
}


/* ═══════════════════════════════════════════════════════════════════════
   MEETING / VIDEO CALL FEATURE — IDE DARK MODE DOCK
════════════════════════════════════════════════════════════════════════ */

:root {
  /* Matches the Exam Portal / IDE palette (see :root at top of file) */
  --meeting-bg:       #000000;
  --meeting-bg2:      #0d0d0d;
  --meeting-bg3:      #151515;
  --meeting-bg4:      #222222;
  --meeting-border:   #222222;
  --meeting-border2:  #333333;
  --meeting-emerald:  #4ec9b0;
  --meeting-emerald2: #3dab96;
  --meeting-red:      #f48771;
  --meeting-text:     #cccccc;
  --meeting-text2:    #9d9d9d;
  --meeting-text3:    #858585;
  --meeting-glass:    rgba(13, 13, 13, 0.85);
}

/* ── Join Call Button (title bar) ─────────────────── */
.tbtn-meeting {
  background: rgba(78, 201, 176, 0.1) !important;
  border-color: var(--meeting-emerald) !important;
  color: var(--meeting-emerald) !important;
  font-weight: 600;
}

.tbtn-meeting:hover {
  background: rgba(78, 201, 176, 0.2) !important;
  box-shadow: 0 0 12px rgba(78, 201, 176, 0.35);
}

.tbtn-meeting.active {
  background: var(--meeting-emerald) !important;
  color: #000000 !important;
}

/* ── Meeting screens (Exam-Portal style) ────────────── */
.meeting-screen {
  display: flex;
  flex-direction: column;
  flex: 1;
  min-height: 0;
}

/* Meeting role cards mirror exam-role-card; icons get IDE-gray strokes
   that shift to emerald on hover, just like the exam portal accent. */
.meeting-screen .exam-role-icon svg {
  fill: none;
  stroke: var(--meeting-text2);
}
.meeting-screen .exam-role-card:hover .exam-role-icon svg {
  stroke: var(--meeting-emerald);
}

.meeting-room-id-row {
  display: flex;
  gap: 8px;
  align-items: center;
}
.meeting-room-id-row .exam-input {
  flex: 1;
}

.meeting-gen-btn {
  height: 34px;
  padding: 0 14px;
  background: var(--meeting-bg4);
  border: 1px solid var(--meeting-border2);
  border-radius: 4px;
  color: var(--meeting-text2);
  cursor: pointer;
  font-size: 14px;
  flex-shrink: 0;
  transition: all 0.15s;
}
.meeting-gen-btn:hover {
  background: var(--meeting-bg3);
  border-color: var(--meeting-emerald);
  color: var(--meeting-emerald);
}

.meeting-form-actions {
  display: flex;
  gap: 10px;
  justify-content: flex-end;
  margin-top: 4px;
}

.meeting-status-msg {
  display: none;
  font-size: 11px;
  font-family: 'JetBrains Mono', monospace;
  margin-top: 8px;
  line-height: 1.5;
}
.meeting-status-msg.error   { color: var(--meeting-red); }
.meeting-status-msg.success { color: var(--meeting-emerald); }

.meeting-gen-btn {
  padding: 10px 14px;
  background: var(--meeting-bg3);
  border: 1px solid var(--meeting-border);
  border-radius: 6px;
  color: var(--meeting-text2);
  cursor: pointer;
  font-size: 15px;
  transition: background 0.2s, border-color 0.2s;
  white-space: nowrap;
  height: 42px;
}

.meeting-gen-btn:hover {
  background: var(--meeting-border);
  border-color: var(--meeting-emerald);
  color: var(--meeting-emerald);
}



/* ── Meeting Container (fullscreen overlay) ────────── */
.meeting-container {
  display: flex;
  flex-direction: column;
  background: var(--meeting-bg);
  color: var(--meeting-text);
  font-family: 'Segoe UI', system-ui, sans-serif;
}

/* ── Top Bar (Teams-style control bar) ──────────────── */
.meeting-topbar {
  height: 48px;
  background: var(--meeting-bg2);
  border-bottom: 1px solid var(--meeting-border);
  display: flex;
  align-items: center;
  padding: 0 14px;
  gap: 12px;
  flex-shrink: 0;
  position: relative;
  z-index: 30;
}

.meeting-topbar-left {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
}

.meeting-topbar-center {
  display: flex;
  align-items: center;
  gap: 6px;
  flex: 1;
  justify-content: center;
}

.meeting-topbar-right {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

.meeting-topbar-divider {
  width: 1px;
  height: 26px;
  background: var(--meeting-border2);
  margin: 0 6px;
}

.meeting-room-info {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  font-weight: 500;
}

.meeting-room-label {
  color: var(--meeting-text2);
  font-family: 'JetBrains Mono', monospace;
}

.meeting-participant-count {
  padding: 2px 8px;
  background: rgba(78, 201, 176, 0.1);
  border: 1px solid rgba(78, 201, 176, 0.25);
  border-radius: 10px;
  color: var(--meeting-emerald);
  font-size: 11px;
  font-weight: 600;
}

.meeting-icon-btn {
  width: 34px;
  height: 34px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: transparent;
  border: 1px solid transparent;
  border-radius: 6px;
  color: var(--meeting-text2);
  cursor: pointer;
  transition: background 0.2s, color 0.2s, border-color 0.2s;
}

.meeting-icon-btn:hover {
  background: rgba(255, 255, 255, 0.06);
  color: var(--meeting-text);
  border-color: var(--meeting-border);
}

/* ── Video Area ──────────────────────────────────────── */
.meeting-video-area {
  flex: 1;
  position: relative;
  overflow: hidden;
  display: flex;
  align-items: stretch;
  justify-content: stretch;
  min-height: 0;
}

/* When screen sharing: the screen stage gets the area, filmstrip goes to the side */
.meeting-video-area.presentation-mode {
  flex-direction: row;
  align-items: stretch;
  justify-content: stretch;
}
.meeting-video-area.presentation-mode .meeting-screen-stage {
  flex: 1;
  height: 100%;
}
.meeting-video-area.presentation-mode .meeting-remote-grid {
  width: 280px;
  max-width: 30vw;
  height: 100%;
}

.meeting-video-tile {
  position: relative;
  border-radius: 8px;
  overflow: hidden;
  background: var(--meeting-bg2);
  border: 1px solid var(--meeting-border);
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.4);
}

.meeting-local-tile {
  width: 220px;
  height: 160px;
  position: absolute;
  bottom: 24px;
  right: 24px;
  z-index: 10;
  border-color: var(--meeting-emerald);
  cursor: grab;
  touch-action: none;
  user-select: none;
  -webkit-user-select: none;
  transition: width 0.3s cubic-bezier(0.4, 0, 0.2, 1), height 0.3s cubic-bezier(0.4, 0, 0.2, 1),
    inset 0.3s cubic-bezier(0.4, 0, 0.2, 1), border-color 0.3s, box-shadow 0.3s;
}

.meeting-local-tile.dragging {
  transition: none;
  cursor: grabbing;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.6);
}

/* Solo mode: the self-view is the main stage (full video) — handled by the
   .self-main rules below. When minimized it becomes the draggable PiP. */

/* Self-view hand badge (top-right of the tile) */
.meeting-hand-badge {
  position: absolute;
  top: 8px;
  right: 8px;
  width: 26px;
  height: 26px;
  display: none;
  align-items: center;
  justify-content: center;
  background: rgba(245, 176, 65, 0.95);
  border-radius: 50%;
  font-size: 14px;
  z-index: 8;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.4);
}

/* Spotlight exit button — visible only while a user is pinned to the stage */
.meeting-spotlight-exit {
  position: absolute;
  top: 14px;
  right: 16px;
  display: none;
  align-items: center;
  gap: 6px;
  padding: 5px 14px;
  background: rgba(13, 13, 13, 0.75);
  border: 1px solid var(--meeting-border);
  border-radius: 12px;
  color: var(--meeting-text);
  font-size: 12px;
  font-weight: 500;
  cursor: pointer;
  z-index: 3;
  transition: background 0.2s, border-color 0.2s, color 0.2s;
}

.meeting-spotlight-exit:hover {
  background: rgba(78, 201, 176, 0.2);
  border-color: var(--meeting-emerald);
  color: var(--meeting-emerald);
}

/* Gallery grid: uniform cells that fill the area. 2 or 4+ users → 2 columns,
   3 users → 3 columns (class .g3). Grid is %-based, so it reflows when the
   window resizes or the app enters fullscreen. */
.meeting-remote-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  grid-auto-rows: minmax(0, 1fr);
  gap: 16px;
  width: 100%;
  height: 100%;
  padding: 24px;
  box-sizing: border-box;
  align-content: center;
  justify-content: center;
}

/* Grid fills dynamically: tiles stretch to fill available space */
.meeting-remote-grid.gallery {
  align-items: stretch;
  align-content: center;
}
.meeting-remote-grid.gallery .meeting-remote-tile {
  aspect-ratio: auto;
  height: 100%;
}
.meeting-remote-grid.gallery .meeting-remote-tile video {
  aspect-ratio: auto;
  height: 100%;
}

/* 2-person grid: each tile fills half the area */
.meeting-remote-grid.gallery:not(.many):not(.g3) {
  grid-template-columns: 1fr 1fr;
  grid-template-rows: 1fr;
}

/* 3-person grid: two on top, one below */
.meeting-remote-grid.g3 {
  grid-template-columns: 1fr 1fr;
  grid-template-rows: 1fr 1fr;
  grid-auto-rows: 1fr;
}
.meeting-remote-grid.g3 .meeting-remote-tile:nth-child(3) {
  grid-column: 1 / -1;
}

/* Many participants (>4): compact tiles */
.meeting-remote-grid.many {
  grid-template-columns: repeat(2, 1fr);
  grid-auto-rows: minmax(0, 1fr);
}

/* Strip (spotlight filmstrip on the right) */
.meeting-remote-grid.strip {
  flex-direction: column;
  width: 260px;
  max-width: 25vw;
  height: 100%;
  padding: 12px;
  gap: 10px;
}
.meeting-remote-grid.strip .meeting-remote-tile {
  width: 100%;
  height: 100%;
}

/* Empty grid: hide since screen stage or self-view owns the area */
.meeting-remote-grid:empty {
  display: none;
}

.meeting-remote-grid.g3 {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

/* Self-view becomes a uniform cell in gallery mode and in the spotlight
   filmstrip (when someone else is pinned) */
.meeting-remote-grid.gallery .meeting-local-tile,
.meeting-remote-grid.strip .meeting-local-tile {
  position: relative;
  width: 100%;
  height: 100%;
  left: auto;
  top: auto;
  right: auto;
  bottom: auto;
  transform: none;
  cursor: default;
  z-index: auto;
  transition: width 0.3s, height 0.3s, border-color 0.3s, box-shadow 0.3s;
}

.meeting-remote-tile {
  position: relative;
  min-height: 0;
  min-width: 0;
  border-radius: 8px;
  overflow: hidden;
  background: var(--meeting-bg2);
  border: 1px solid var(--meeting-border);
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.4);
  transition: border-color 0.25s, transform 0.2s;
  display: flex;
  align-items: center;
  justify-content: center;
}

.meeting-remote-tile.talking {
  border-color: var(--meeting-emerald);
  box-shadow: 0 0 16px rgba(78, 201, 176, 0.3);
}

/* Video fills its tile container */
.meeting-remote-tile video {
  flex: 1;
  width: 100%;
  height: 100%;
  object-fit: cover;
  background: #111827;
  border-radius: 7px;
}

/* "Others" tile (large meetings: 3 named tiles + others) */
.meeting-others-tile {
  position: relative;
  min-height: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border-radius: 8px;
  background: var(--meeting-bg2);
  border: 1px dashed var(--meeting-border2);
  color: var(--meeting-text2);
  cursor: pointer;
  transition: border-color 0.2s, color 0.2s, background 0.2s;
}

.meeting-others-tile:hover,
.meeting-others-tile:focus-visible {
  border-color: var(--meeting-emerald);
  color: var(--meeting-text);
  background: rgba(78, 201, 176, 0.08);
  outline: none;
}

.meeting-others-count {
  font-size: 36px;
  font-weight: 700;
  line-height: 1;
  font-family: 'JetBrains Mono', monospace;
  color: var(--meeting-emerald);
}

.meeting-others-label {
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.6px;
  text-transform: uppercase;
}

/* Paged 4x4 "Others" viewer */
.meeting-others-overlay {
  position: absolute;
  inset: 0;
  z-index: 60;
  display: flex;
  flex-direction: column;
  background: rgba(8, 10, 12, 0.97);
}

.meeting-others-header {
  height: 52px;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 0 18px;
  border-bottom: 1px solid var(--meeting-border);
  flex-shrink: 0;
}

.meeting-others-title {
  font-size: 13px;
  font-weight: 600;
  color: var(--meeting-text);
}

.meeting-others-nav {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-left: auto;
}

.meeting-others-nav-btn {
  width: 30px;
  height: 30px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: transparent;
  border: 1px solid var(--meeting-border);
  border-radius: 6px;
  color: var(--meeting-text2);
  cursor: pointer;
  transition: background 0.2s, color 0.2s, border-color 0.2s;
}

.meeting-others-nav-btn:hover:not(:disabled) {
  background: rgba(78, 201, 176, 0.12);
  color: var(--meeting-emerald);
  border-color: var(--meeting-emerald);
}

.meeting-others-nav-btn:disabled {
  opacity: 0.35;
  cursor: default;
}

.meeting-others-page {
  font-size: 12px;
  color: var(--meeting-text2);
  font-family: 'JetBrains Mono', monospace;
  min-width: 52px;
  text-align: center;
}

.meeting-others-close {
  width: 30px;
  height: 30px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: transparent;
  border: 1px solid transparent;
  border-radius: 6px;
  color: var(--meeting-text2);
  cursor: pointer;
  transition: background 0.2s, color 0.2s;
}

.meeting-others-close:hover {
  background: rgba(244, 135, 113, 0.15);
  color: var(--meeting-red);
}

.meeting-others-grid {
  flex: 1;
  min-height: 0;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  grid-auto-rows: minmax(0, 1fr);
  gap: 12px;
  padding: 18px;
  overflow: hidden auto;
}

.meeting-remote-tile video {
  width: 100%;
  height: 100%;
  object-fit: cover;
  background: #151515;
  border-radius: 7px;
}

.meeting-initials-overlay {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, #151515 0%, #0d0d0d 100%);
  border-radius: 7px;
}

.meeting-initials-text {
  font-size: 42px;
  font-weight: 700;
  color: var(--meeting-text);
  text-shadow: 0 2px 12px rgba(0, 0, 0, 0.5);
  font-family: 'JetBrains Mono', monospace;
}

.meeting-user-label {
  position: absolute;
  bottom: 8px;
  left: 8px;
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 3px 8px;
  background: rgba(13, 13, 13, 0.85);
  border-radius: 4px;
  font-size: 11px;
  font-weight: 500;
  color: var(--meeting-text);
  border: 1px solid var(--meeting-border);
}

.meeting-status-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  flex-shrink: 0;
}

.meeting-status-connected {
  background: var(--meeting-emerald);
  box-shadow: 0 0 8px var(--meeting-emerald);
}

.meeting-status-muted {
  background: var(--meeting-red);
  box-shadow: 0 0 8px var(--meeting-red);
}

.meeting-status-off {
  background: #555555;
}

/* Mic-off icon inside tile labels */
.meeting-tile-mic {
  display: inline-flex;
  align-items: center;
  color: var(--meeting-red);
  margin-left: 4px;
}

.meeting-tile-mic .meeting-slash {
  opacity: 1;
}

/* ── Participants panel (Teams-style sidebar) ───────── */
.meeting-participants-panel {
  position: absolute;
  top: 48px;
  right: 0;
  bottom: 0;
  width: 320px;
  background: var(--meeting-bg2);
  border-left: 1px solid var(--meeting-border);
  display: flex;
  flex-direction: column;
  z-index: 22;
  box-shadow: -4px 0 20px rgba(0, 0, 0, 0.3);
}

.meeting-panel-header {
  height: 44px;
  display: flex;
  align-items: center;
  padding: 0 10px 0 16px;
  border-bottom: 1px solid var(--meeting-border);
  flex-shrink: 0;
}

.meeting-panel-title {
  font-size: 14px;
  font-weight: 600;
  color: var(--meeting-text);
}

.meeting-panel-header-actions {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 2px;
}

.meeting-panel-invite {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 12px 14px;
  flex-shrink: 0;
}

.meeting-invite-input {
  flex: 1;
  height: 34px;
  padding: 0 12px;
  background: var(--meeting-bg);
  border: 1px solid var(--meeting-border);
  border-radius: 6px;
  color: var(--meeting-text2);
  font-size: 12px;
  font-family: 'JetBrains Mono', monospace;
  outline: none;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.meeting-invite-input:focus {
  border-color: var(--meeting-emerald);
}

.meeting-panel-section-title {
  padding: 10px 16px 6px 16px;
  font-size: 12px;
  font-weight: 600;
  color: var(--meeting-text);
  border-bottom: 1px solid var(--meeting-border);
  flex-shrink: 0;
}

.meeting-participant-list {
  flex: 1;
  overflow-y: auto;
  padding: 8px;
}

.meeting-participant-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 8px 10px;
  border-radius: 8px;
  transition: background 0.15s;
}

.meeting-participant-row:hover {
  background: rgba(255, 255, 255, 0.05);
}

.meeting-participant-avatar {
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background: rgba(78, 201, 176, 0.18);
  border: 1px solid rgba(78, 201, 176, 0.35);
  color: var(--meeting-emerald);
  font-size: 14px;
  font-weight: 700;
  font-family: 'JetBrains Mono', monospace;
  flex-shrink: 0;
}

.meeting-participant-info {
  flex: 1;
  min-width: 0;
}

.meeting-participant-name {
  font-size: 13px;
  font-weight: 500;
  color: var(--meeting-text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.meeting-participant-role {
  font-size: 11px;
  color: var(--meeting-text3);
}

.meeting-participant-status {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

.meeting-participant-mic {
  display: inline-flex;
  color: var(--meeting-red);
}

.meeting-participant-hand {
  font-size: 14px;
}

.meeting-participant-kick {
  display: none;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  border: none;
  border-radius: 6px;
  background: transparent;
  color: var(--meeting-text-muted, #9ca3af);
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
  padding: 0;
}
.meeting-participant-row:hover .meeting-participant-kick {
  display: inline-flex;
}
.meeting-participant-kick:hover {
  background: rgba(239, 68, 68, 0.2);
  color: #ef4444;
}

/* ── Control buttons (Teams-style icon buttons) ─────── */
.meeting-ctrl-btn {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  background: transparent;
  border: 1px solid transparent;
  border-radius: 50%;
  color: var(--meeting-text);
  cursor: pointer;
  transition: background 0.2s, border-color 0.2s, color 0.2s;
}

.meeting-ctrl-btn:hover {
  background: rgba(255, 255, 255, 0.08);
  border-color: var(--meeting-border);
}

.meeting-ctrl-btn:active {
  transform: scale(0.94);
}

.meeting-ctrl-icon {
  fill: none;
  stroke: var(--meeting-text);
  transition: stroke 0.2s, fill 0.2s;
}

/* Raise-hand control uses a clear emoji instead of a thin line icon */
.meeting-hand-emoji {
  font-size: 20px;
  line-height: 1;
  filter: drop-shadow(0 1px 2px rgba(0, 0, 0, 0.4));
}

.meeting-ctrl-btn:hover .meeting-ctrl-icon {
  stroke: #ffffff;
}

/* Strike-through slash shown when mic/camera is off */
.meeting-slash {
  opacity: 0;
  transition: opacity 0.2s;
  stroke: var(--meeting-red);
}

.meeting-ctrl-btn.off .meeting-slash {
  opacity: 1;
}

.meeting-ctrl-btn.off .meeting-ctrl-icon {
  stroke: var(--meeting-text2);
}

/* Active button: emerald underline indicator (Teams-style) */
.meeting-ctrl-btn.active::after {
  content: "";
  position: absolute;
  bottom: -8px;
  left: 25%;
  right: 25%;
  height: 2px;
  border-radius: 2px;
  background: var(--meeting-emerald);
}

.meeting-ctrl-btn.active .meeting-ctrl-icon {
  stroke: var(--meeting-emerald);
}

/* Amber "hand up" state */
.meeting-ctrl-btn.hand-up .meeting-ctrl-icon {
  stroke: #f5b041;
}

.meeting-ctrl-btn.hand-up::after {
  background: #f5b041;
}

/* ── More actions / Leave dropdown menus ─────────────── */
.meeting-more-wrap {
  position: relative;
  display: flex;
}

.meeting-more-menu,
.meeting-leave-menu {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  min-width: 190px;
  display: none;
  flex-direction: column;
  padding: 6px;
  background: var(--meeting-bg3);
  border: 1px solid var(--meeting-border2);
  border-radius: 8px;
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.6);
  z-index: 50;
}

.meeting-more-menu.open,
.meeting-leave-menu.open {
  display: flex;
}

.meeting-more-title {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.8px;
  text-transform: uppercase;
  color: var(--meeting-text3);
  padding: 4px 10px 2px 10px;
}

.meeting-more-emojis {
  display: flex;
  gap: 2px;
  padding: 2px 6px 6px 6px;
}

.meeting-react-emoji {
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: transparent;
  border: none;
  border-radius: 50%;
  font-size: 19px;
  cursor: pointer;
  transition: transform 0.15s, background 0.15s;
}

.meeting-react-emoji:hover {
  transform: scale(1.25);
  background: rgba(78, 201, 176, 0.15);
}

.meeting-more-sep {
  height: 1px;
  background: var(--meeting-border2);
  margin: 4px 2px;
}

.meeting-more-item {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 8px 12px;
  background: transparent;
  border: none;
  border-radius: 6px;
  color: var(--meeting-text);
  font-size: 12px;
  font-family: 'Segoe UI', system-ui, sans-serif;
  text-align: left;
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
}

.meeting-more-item:hover {
  background: rgba(78, 201, 176, 0.12);
  color: var(--meeting-emerald);
}

/* Leave button (red pill, Teams-style) */
.meeting-leave-wrap {
  position: relative;
  display: flex;
  align-items: center;
}

.meeting-leave-btn {
  display: flex;
  align-items: center;
  gap: 7px;
  height: 36px;
  padding: 0 16px;
  background: #c4314b;
  border: none;
  border-radius: 18px 0 0 18px;
  color: #ffffff;
  font-size: 13px;
  font-weight: 600;
  font-family: 'Segoe UI', system-ui, sans-serif;
  cursor: pointer;
  transition: background 0.2s;
}

.meeting-leave-btn:hover {
  background: #d8455f;
}

.meeting-leave-chevron {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 36px;
  background: #c4314b;
  border: none;
  border-radius: 0 18px 18px 0;
  color: #ffffff;
  cursor: pointer;
  transition: background 0.2s;
}

.meeting-leave-chevron:hover {
  background: #d8455f;
}

/* ── Floating reaction emoji burst (center-bottom, Teams-style) ── */
.meeting-reaction-stage {
  position: absolute;
  left: 50%;
  bottom: 18%;
  transform: translateX(-50%);
  display: flex;
  align-items: center;
  gap: 14px;
  z-index: 40;
  pointer-events: none;
}

.meeting-reaction-burst {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  filter: drop-shadow(0 2px 8px rgba(0, 0, 0, 0.5));
  animation: meeting-reaction-float 2.2s ease-out forwards;
}

.meeting-reaction-emoji {
  font-size: 38px;
  line-height: 1;
}

.meeting-reaction-name {
  font-size: 10.5px;
  font-weight: 600;
  color: #ffffff;
  background: rgba(13, 13, 13, 0.7);
  border: 1px solid var(--meeting-border2);
  border-radius: 10px;
  padding: 2px 8px;
  max-width: 110px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

@keyframes meeting-reaction-float {
  0% {
    opacity: 0;
    transform: translateY(10px) scale(0.5);
  }
  15% {
    opacity: 1;
    transform: translateY(0) scale(1.15);
  }
  70% {
    opacity: 1;
    transform: translateY(-60px) scale(1);
  }
  100% {
    opacity: 0;
    transform: translateY(-120px) scale(0.9);
  }
}

/* ── Meeting timer (top bar) ─────────────────────────── */
.meeting-timer {
  padding: 2px 8px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--meeting-border);
  border-radius: 10px;
  font-family: 'JetBrains Mono', monospace;
  font-size: 11px;
  color: var(--meeting-text2);
}

/* ── Solo mode: the self-view fills the whole video area (the one screen) */
.meeting-video-area.meeting-solo .meeting-local-tile {
  width: calc(100% - 48px);
  height: calc(100% - 48px);
  left: 24px;
  top: 24px;
  right: auto;
  bottom: auto;
  transform: none;
  cursor: default;
  z-index: 6;
}

/* ── Spotlight: a user (or yourself) is pinned as MY main stage ─────── */
/* Everyone else becomes a right-side filmstrip (Teams-style). */
.meeting-container.spotlight .meeting-remote-grid {
  position: absolute;
  right: 16px;
  top: 16px;
  bottom: 16px;
  width: 260px;
  grid-template-columns: 1fr;
  grid-auto-rows: minmax(0, 1fr);
  gap: 10px;
  padding: 0;
  z-index: 12;
  align-content: start;
  overflow: hidden auto;
}

.meeting-container.spotlight .meeting-remote-tile {
  aspect-ratio: auto;
  min-height: 0;
  border-radius: 8px;
}

.meeting-container.spotlight .meeting-remote-grid:empty {
  display: none;
}

/* Spotlighted user's camera fills the stage (cover, not letterboxed) */
.meeting-screen-stage.spotlight video {
  object-fit: cover;
}

.meeting-screen-stage.spotlight .meeting-spotlight-exit {
  display: flex;
}

/* ── Chat Drawer ─────────────────────────────────────── */
.meeting-chat-drawer {
  position: absolute;
  top: 48px;
  right: 0;
  width: 320px;
  height: calc(100% - 48px);
  background: var(--meeting-bg2);
  border-left: 1px solid var(--meeting-border);
  display: flex;
  flex-direction: column;
  z-index: 20;
  box-shadow: -4px 0 20px rgba(0, 0, 0, 0.3);
}

.meeting-chat-header {
  height: 40px;
  display: flex;
  align-items: center;
  padding: 0 14px;
  border-bottom: 1px solid var(--meeting-border);
  flex-shrink: 0;
}

.meeting-chat-title {
  font-size: 12px;
  font-weight: 600;
  color: var(--meeting-text);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.meeting-chat-messages {
  flex: 1;
  overflow-y: auto;
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.meeting-chat-msg {
  padding: 8px 12px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--meeting-border);
  border-radius: 4px;
  font-size: 12px;
  line-height: 1.5;
  max-width: 90%;
}

.meeting-chat-msg.from-me {
  align-self: flex-end;
  background: rgba(78, 201, 176, 0.1);
  border-color: rgba(78, 201, 176, 0.2);
  color: var(--meeting-emerald);
}

.meeting-chat-msg.from-other {
  align-self: flex-start;
  color: var(--meeting-text);
}

.meeting-chat-msg.system {
  align-self: center;
  background: transparent;
  border-color: transparent;
  color: var(--meeting-text2);
  font-style: italic;
  font-size: 11px;
  text-align: center;
  max-width: 100%;
}

.meeting-chat-msg .msg-sender {
  display: block;
  font-size: 10px;
  font-weight: 600;
  color: var(--meeting-emerald);
  margin-bottom: 2px;
  font-family: 'JetBrains Mono', monospace;
}

.meeting-chat-msg.from-other .msg-sender {
  color: var(--meeting-text2);
}

.meeting-chat-input-area {
  height: 48px;
  display: flex;
  align-items: center;
  padding: 0 12px;
  border-top: 1px solid var(--meeting-border);
  gap: 8px;
  flex-shrink: 0;
}

.meeting-chat-input {
  flex: 1;
  padding: 8px 12px;
  background: var(--meeting-bg);
  border: 1px solid var(--meeting-border);
  border-radius: 6px;
  color: var(--meeting-text);
  font-size: 12px;
  font-family: 'JetBrains Mono', monospace;
  outline: none;
  transition: border-color 0.2s;
}

.meeting-chat-input:focus {
  border-color: var(--meeting-emerald);
}

.meeting-send-btn {
  padding: 6px 14px;
  font-size: 12px;
  height: 32px;
}

.meeting-send-btn:hover {
  box-shadow: 0 0 12px rgba(78, 201, 176, 0.3);
}

/* Frozen submit buttons while a call is starting */
.exam-btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  pointer-events: none;
}

/* ── Screen share stage (Teams-style presentation) ─────── */
.meeting-screen-stage {
  position: absolute;
  inset: 0;
  z-index: 5;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #000;
}

.meeting-screen-stage video {
  width: 100%;
  height: 100%;
  object-fit: contain;
  background: #000;
}

.meeting-screen-label {
  position: absolute;
  top: 14px;
  left: 16px;
  padding: 4px 12px;
  background: rgba(13, 13, 13, 0.75);
  border: 1px solid var(--meeting-border);
  border-radius: 12px;
  font-size: 12px;
  font-weight: 500;
  color: var(--meeting-text);
  z-index: 2;
  pointer-events: none;
}

.meeting-container.presentation-mode .meeting-video-area {
  flex-direction: row;
}

/* Presenter's camera stays visible as a small PiP (bottom-left) */
.meeting-container.presentation-mode .meeting-local-tile {
  left: 24px;
  right: auto;
  top: auto;
  bottom: 24px;
}

/* Remote cameras become a filmstrip on the right */
.meeting-container.presentation-mode .meeting-remote-grid {
  position: absolute;
  right: 16px;
  top: 16px;
  bottom: 16px;
  width: 260px;
  grid-template-columns: 1fr;
  grid-auto-rows: minmax(0, 1fr);
  gap: 10px;
  padding: 0;
  z-index: 12;
  align-content: start;
  overflow: hidden auto;
}

.meeting-container.presentation-mode .meeting-remote-grid:empty {
  display: none;
}

.meeting-container.presentation-mode .meeting-remote-tile {
  aspect-ratio: auto;
  min-height: 0;
  border-radius: 8px;
}

/* ── Local tile controls (minimize / restore) ───────── */
.meeting-tile-controls {
  position: absolute;
  top: 6px;
  right: 6px;
  display: flex;
  gap: 4px;
  z-index: 10;
  opacity: 0;
  transition: opacity 0.2s;
}
.meeting-local-tile:hover .meeting-tile-controls,
.meeting-local-tile.minimized .meeting-tile-controls {
  opacity: 1;
}
.meeting-tile-btn {
  width: 24px;
  height: 24px;
  border: none;
  border-radius: 6px;
  background: rgba(10, 10, 10, 0.7);
  color: var(--meeting-text);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: background 0.15s;
}
.meeting-tile-btn:hover {
  background: rgba(50, 50, 50, 0.9);
}

/* Minimized self-view: small fixed PiP in the bottom-left corner */
.meeting-local-tile.minimized {
  width: 160px !important;
  height: 110px !important;
  min-width: 160px !important;
  min-height: 110px !important;
  position: fixed !important;
  left: 16px !important;
  right: auto !important;
  top: auto !important;
  bottom: 80px !important;
  z-index: 500;
  border-radius: 10px;
  box-shadow: 0 4px 20px rgba(0,0,0,0.5);
  cursor: move;
  border: 1px solid var(--meeting-border);
}
.meeting-local-tile.minimized .meeting-user-label,
.meeting-local-tile.minimized .meeting-hand-badge,
.meeting-local-tile.minimized .meeting-tile-mic {
  display: none !important;
}
.meeting-local-tile.minimized video {
  border-radius: 10px !important;
}

/* Focus mode: screen share fills the entire area — hides filmstrip, self-view,
   topbar, and all controls so the shared content is front-and-center.
   Hover anywhere to reveal the topbar + stage controls temporarily. */
.meeting-container.focus-mode .meeting-remote-grid {
  display: none !important;
}
.meeting-container.focus-mode .meeting-local-tile {
  display: none !important;
}
.meeting-container.focus-mode .meeting-topbar {
  opacity: 0 !important;
  pointer-events: none !important;
  transition: opacity 0.3s;
}
.meeting-container.focus-mode:hover .meeting-topbar {
  opacity: 1 !important;
  pointer-events: auto !important;
}
.meeting-container.focus-mode .meeting-screen-stage {
  z-index: 8;
  inset: 0;
}
.meeting-container.focus-mode .meeting-screen-stage video {
  width: 100%;
  height: 100%;
  object-fit: contain;
}
.meeting-container.focus-mode .meeting-screen-stage .meeting-focus-btn,
.meeting-container.focus-mode .meeting-screen-stage .meeting-spotlight-exit {
  opacity: 0;
  transition: opacity 0.3s;
}
.meeting-container.focus-mode .meeting-screen-stage:hover .meeting-focus-btn,
.meeting-container.focus-mode .meeting-screen-stage:hover .meeting-spotlight-exit {
  opacity: 1;
}

/* Focus button on the screen stage */
.meeting-focus-btn {
  position: absolute;
  top: 14px;
  z-index: 10;
  width: 32px;
  height: 32px;
  border: 1px solid var(--meeting-border);
  border-radius: 8px;
  background: rgba(13, 13, 13, 0.75);
  color: var(--meeting-text);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
}
.meeting-focus-btn:hover {
  background: rgba(16, 185, 129, 0.25);
  color: #10b981;
}
.meeting-focus-btn.active {
  background: #10b981;
  color: #000;
}
#meeting-focus-btn { right: 50px; }
#meeting-screen-fullscreen-btn { right: 16px; }

/* Screen stage controls (fullscreen + focus buttons on the stage) */
.meeting-stage-controls {
  position: absolute;
  top: 14px;
  right: 108px;
  display: flex;
  gap: 8px;
  z-index: 10;
}
.meeting-screen-btn {
  width: 32px;
  height: 32px;
  border: 1px solid var(--meeting-border);
  border-radius: 8px;
  background: rgba(13, 13, 13, 0.75);
  color: var(--meeting-text);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
}
.meeting-screen-btn:hover {
  background: rgba(16, 185, 129, 0.25);
  color: #10b981;
}

/* ── Chat + media dynamic layout ────────────────────────────────────────── */
/* When the chat drawer is open it takes the right slice of the meeting UI;
   the video area (and the screen stage inside it) must shrink so the two
   panels sit side by side without overlapping each other. */
.meeting-container.chat-open .meeting-video-area {
  flex: 1;
  min-width: 0;
}

/* When chat is open, presentation mode lays out as a 3-pane stack:
   screen stage (flex-1) + remote filmstrip + chat drawer. */
.meeting-container.chat-open.presentation-mode .meeting-video-area.presentation-mode {
  flex-direction: column;
}
.meeting-container.chat-open.presentation-mode .meeting-screen-stage {
  flex: 1;
}
.meeting-container.chat-open.presentation-mode .meeting-remote-grid {
  position: relative;
  width: 100%;
  max-width: none;
  height: 120px;
  flex-direction: row;
  align-content: stretch;
  overflow: auto;
  flex-shrink: 0;
}

/* Focus mode hides the chat drawer the same way it hides everything else. */
.meeting-container.focus-mode .meeting-chat-drawer {
  display: none !important;
}

/* Focus mode: hide topbar, keep screen stage controls */
.meeting-container.focus-mode .meeting-screen-stage .meeting-stage-controls {
  opacity: 1 !important;
}
.meeting-container.focus-mode .meeting-screen-stage .meeting-focus-btn {
  opacity: 1 !important;
}
.meeting-container.focus-mode .meeting-screen-stage .meeting-spotlight-exit {
  opacity: 1 !important;
}

/* ── Toast Notifications ────────────────────────────── */
.toast-container {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 9500;
  pointer-events: none;
  max-width: min(460px, calc(100vw - 32px));
}

.toast {
  display: flex;
  align-items: center;
  gap: 8px;
  max-width: 100%;
  padding: 7px 16px;
  background: var(--meeting-bg3);
  border: 1px solid var(--meeting-border2);
  border-radius: 20px;
  color: var(--meeting-text);
  font-size: 11.5px;
  font-weight: 500;
  line-height: 1.4;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.4);
  pointer-events: auto;
  transition: opacity 0.22s ease;
}

.toast.toast-in {
  animation: toast-in 0.25s ease-out;
}

.toast.toast-out {
  opacity: 0;
}

.toast.error {
  border-color: rgba(244, 135, 113, 0.5);
  color: var(--meeting-red);
}

.toast.success {
  border-color: rgba(78, 201, 176, 0.4);
  color: var(--meeting-emerald);
}

@keyframes toast-in {
  from {
    opacity: 0;
    transform: translateY(10px) scale(0.96);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

/* ── Pulse animation for connected dot ─────────────── */
@keyframes meeting-pulse {
  0% { box-shadow: 0 0 0 0 rgba(78, 201, 176, 0.6); }
  70% { box-shadow: 0 0 0 8px rgba(78, 201, 176, 0); }
  100% { box-shadow: 0 0 0 0 rgba(78, 201, 176, 0); }
}

.meeting-status-connected {
  animation: meeting-pulse 2s infinite;
}
.exam-question-media {
  display: block;
  max-width: min(100%, 720px);
  max-height: 420px;
  width: auto;
  height: auto;
  object-fit: contain;
  margin: 12px 0;
  border: 1px solid var(--border2);
  border-radius: 6px;
  background: #090b0f;
}
.exam-question-video {
  width: min(100%, 720px);
}
.exam-question-preview {
  min-height: 28px;
  padding: 8px 10px;
  border: 1px dashed var(--border2);
  border-radius: 5px;
  color: var(--text2);
  background: rgba(255,255,255,.015);
  font-size: 12px;
  line-height: 1.55;
}
.file-type-icon { width:16px; height:16px; display:block; flex-shrink:0; }
.file-item .folder-chevron { width:14px; height:16px; display:inline-flex; align-items:center; justify-content:center; color:var(--text3); flex:0 0 14px; line-height:1; }
.file-item .folder-chevron svg { width:12px; height:12px; display:block; fill:none; stroke:currentColor; stroke-width:1.5; stroke-linecap:round; stroke-linejoin:round; transition:transform .12s ease; }
.file-item .folder-chevron.expanded svg { transform:rotate(90deg); }
.workspace-file-preview { display:none; position:absolute; inset:0; overflow:hidden; background:var(--bg); flex-direction:column; }
#cm-wrap { position:relative; }
#cm-wrap.preview-active .CodeMirror { display:none; }
.workspace-file-preview.active { display:flex; }
.workspace-preview-toolbar { min-height:30px; display:flex; align-items:center; gap:12px; padding:2px 10px; border-bottom:1px solid var(--border); background:var(--bg2); flex-shrink:0; }
.workspace-preview-title { overflow:hidden; text-overflow:ellipsis; white-space:nowrap; color:var(--text2); font-size:11px; flex:1; }
.workspace-preview-controls { display:flex; align-items:center; gap:2px; margin-left:auto; }
.workspace-preview-controls button { min-width:27px; height:25px; padding:0 7px; border:1px solid transparent; border-radius:3px; background:transparent; color:var(--text2); cursor:pointer; font:16px/1 'Segoe UI',sans-serif; }
.workspace-preview-controls button:hover { background:var(--hl2); color:#fff; border-color:var(--border2); }
.workspace-preview-zoom { min-width:42px; color:var(--text2); font-size:11px; text-align:center; }
.workspace-preview-stage { flex:1; min-height:0; overflow:auto; display:block; padding:24px; background:#080808; }
.workspace-preview-content { width:max-content; min-width:100%; min-height:100%; height:max-content; display:flex; align-items:center; justify-content:center; flex-direction:column; gap:18px; transition:transform .15s ease; transform-origin:center center; }
.workspace-preview-image { max-width:none; max-height:none; width:auto; height:auto; object-fit:contain; }
.workspace-preview-video { max-width:none; max-height:none; width:auto; height:auto; min-width:min(720px, 90%); min-height:min(405px, 70vh); background:#000; object-fit:contain; }
.workspace-preview-audio { width:min(560px, 100%); }
.workspace-preview-pdf { width:100%; height:100%; min-height:80vh; border:0; background:#fff; }
.workspace-pptx-content { width:960px; min-width:960px; min-height:max-content; height:max-content; justify-content:flex-start; padding:0 0 24px; }
.workspace-pptx-slide { width:960px; min-height:0; aspect-ratio:16 / 9; flex:0 0 auto; position:relative; overflow:hidden; color:#1f2937; background:#fff; border-radius:3px; box-shadow:0 6px 24px rgba(0,0,0,.45); }
.workspace-pptx-slide-number { position:absolute; top:12px; right:16px; color:#6b7280; font:11px 'Segoe UI',sans-serif; }
.workspace-pptx-text { position:absolute; font:18px 'Segoe UI',sans-serif; line-height:1.25; white-space:pre-wrap; overflow:hidden; overflow-wrap:anywhere; }
.workspace-pptx-image { position:absolute; display:block; object-fit:contain; }
.workspace-pptx-empty { position:absolute; inset:0; display:grid; place-items:center; padding:40px; color:#6b7280; font:14px 'Segoe UI',sans-serif; text-align:center; }
.workspace-preview-card { max-width:440px; display:flex; flex-direction:column; align-items:center; gap:10px; padding:24px; border:1px solid var(--border2); border-radius:8px; color:var(--text2); text-align:center; background:var(--bg2); }
.workspace-preview-card strong { color:var(--text); font-size:14px; }
.workspace-preview-link { color:var(--blue2); text-decoration:none; margin-top:6px; }
.section-actions .phbtn { width:24px; height:24px; padding:0; display:inline-flex; align-items:center; justify-content:center; color:var(--text3); border-radius:3px; }
.section-actions .phbtn:hover { color:var(--text); background:var(--hl2); }
.file-item.active[data-path] { outline: none; }
.section-actions .phbtn { width: 24px; height: 24px; display:inline-flex; align-items:center; justify-content:center; border-radius:4px; color:var(--text3); }
.section-actions .phbtn:hover { background:var(--hl2); color:var(--text); }
.codicon-toolbar-icon { width:16px; height:16px; display:block; opacity:.85; filter:invert(78%); }
.codicon-toolbar-icon svg { width:16px; height:16px; display:block; }
.section-actions .phbtn:hover .codicon-toolbar-icon { opacity:1; }
.workspace-folder-icon svg { width:15px; height:15px; }
.file-type-icon { display:inline-flex; align-items:center; justify-content:center; width:16px; height:16px; margin-right:6px; border:1px solid; border-radius:3px; font:bold 8px Arial; box-sizing:border-box; }
.tab-file-icon { display:inline-flex; align-items:center; margin-right:3px; }
.tab-file-icon .file-type-icon { margin-right:0; width:14px; height:14px; }
#output-text { white-space:pre; overflow-x:auto; overflow-y:auto; }

/* Compact VS Code-like explorer rows; the icon artwork itself has no CSS frame. */
.file-item { padding-top: 1px; padding-bottom: 1px; min-height: 23px; line-height: 20px; }
.file-item.active { border-left-color: transparent !important; }
.file-type-icon { width:16px; height:16px; margin:0; border:0 !important; border-radius:0; box-sizing:content-box; }
.file-type-icon.inline-svg-icon { display:inline-flex; align-items:center; justify-content:center; }
.file-type-icon.inline-svg-icon svg { width:100%; height:100%; display:block; }
.tab-file-icon .file-type-icon { width:16px; height:16px; margin:0; }

/* ── Meeting control dock / window behavior ───────────────────────────────
   Teams keeps meeting controls at the bottom while meeting identity stays
   above the stage.  The existing DOM is reused, so keyboard shortcuts and
   inline actions keep working. */
.meeting-container > .meeting-topbar {
  position: absolute;
  inset: 0 0 auto 0;
  width: 100%;
  background: linear-gradient(180deg, rgba(10, 10, 10, .92), rgba(10, 10, 10, .42), transparent);
  border-bottom: 0;
  pointer-events: none;
  z-index: 40;
}
.meeting-container > .meeting-topbar > * { pointer-events: auto; }
.meeting-container > .meeting-topbar .meeting-topbar-center {
  position: fixed;
  left: 50%;
  bottom: 24px;
  transform: translateX(-50%);
  width: max-content;
  max-width: calc(100vw - 260px);
  padding: 8px 10px;
  border: 1px solid rgba(255, 255, 255, .12);
  border-radius: 14px;
  background: rgba(31, 31, 31, .94);
  box-shadow: 0 8px 28px rgba(0, 0, 0, .45);
  backdrop-filter: blur(18px);
}
.meeting-container > .meeting-topbar .meeting-topbar-right {
  position: fixed;
  right: 24px;
  bottom: 24px;
  padding: 8px;
  border-radius: 14px;
  background: rgba(31, 31, 31, .94);
  box-shadow: 0 8px 28px rgba(0, 0, 0, .45);
  backdrop-filter: blur(18px);
}
.meeting-container.meeting-minimized {
  inset: auto 22px 22px auto !important;
  width: min(440px, calc(100vw - 32px));
  height: 260px;
  border: 1px solid var(--meeting-border2);
  border-radius: 12px;
  box-shadow: 0 18px 60px rgba(0, 0, 0, .62);
  overflow: hidden;
}
.meeting-container.meeting-minimized > .meeting-topbar {
  position: relative;
  inset: auto;
  height: 42px;
  background: var(--meeting-bg2);
  pointer-events: auto;
}
.meeting-container.meeting-minimized > .meeting-topbar .meeting-topbar-center,
.meeting-container.meeting-minimized > .meeting-topbar .meeting-topbar-right {
  position: static;
  transform: none;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
  backdrop-filter: none;
}
.meeting-container.meeting-minimized .meeting-video-area { min-height: 0; }
.meeting-container.meeting-minimized .meeting-remote-grid { padding: 8px; gap: 6px; }
.meeting-container.meeting-minimized .meeting-local-tile { width: 120px; height: 86px; right: 10px; bottom: 10px; }
.meeting-container.meeting-minimized .meeting-chat-drawer,
.meeting-container.meeting-minimized .meeting-participants-panel { display: none !important; }

@media (max-width: 760px) {
  .meeting-container > .meeting-topbar .meeting-topbar-center {
    left: 8px;
    right: 8px;
    bottom: 10px;
    transform: none;
    width: auto;
    max-width: none;
    justify-content: center;
    gap: 2px;
    padding: 6px;
  }
  .meeting-container > .meeting-topbar .meeting-topbar-right {
    right: 8px;
    bottom: 74px;
    padding: 0;
    background: transparent;
    box-shadow: none;
  }
  .meeting-container > .meeting-topbar .meeting-topbar-left { max-width: 46%; }
  .meeting-room-label { max-width: 120px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .meeting-ctrl-btn { width: 34px; height: 34px; }
}

/* ── Final meeting stage geometry ────────────────────────────────────────
   Keep the presentation stage and participant filmstrip in normal layout
   flow.  The previous absolute layers caused the filmstrip to overlap the
   presentation and made the available space change unpredictably. */
.meeting-container:not(.meeting-minimized) .meeting-video-area {
  padding-top: 64px;
  padding-bottom: 82px;
  box-sizing: border-box;
}
.meeting-container.presentation-mode .meeting-video-area {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 236px;
  gap: 12px;
   padding: 72px 16px 92px;
  background: #050505;
}
.meeting-container.presentation-mode.presentation-no-remote .meeting-video-area {
  grid-template-columns: minmax(0, 1fr);
}
.meeting-container.presentation-mode .meeting-screen-stage {
  position: relative;
  inset: auto;
  width: 100%;
  height: 100%;
  min-width: 0;
  min-height: 0;
  grid-column: 1;
  grid-row: 1;
  z-index: 1;
  border: 1px solid rgba(255,255,255,.1);
  border-radius: 10px;
  overflow: hidden;
}
.meeting-container.presentation-mode .meeting-remote-grid {
  position: relative;
  inset: auto;
  width: 100%;
  max-width: none;
  height: 100%;
  min-width: 0;
  min-height: 0;
  grid-column: 2;
  grid-row: 1;
  display: grid;
  grid-template-columns: 1fr;
  grid-auto-rows: minmax(120px, 1fr);
  align-content: start;
  gap: 10px;
  padding: 0;
  overflow-y: auto;
  z-index: 2;
}
.meeting-container.presentation-mode.presentation-no-remote .meeting-remote-grid { display: none; }
.meeting-container.presentation-mode .meeting-remote-tile {
  width: 100%;
  height: auto;
  min-height: 120px;
  aspect-ratio: 16 / 9;
}
.meeting-container.presentation-mode .meeting-local-tile {
  z-index: 8;
  left: 28px;
  right: auto;
  top: auto;
  bottom: 108px;
}
.meeting-container.presentation-mode .meeting-local-tile.minimized,
.meeting-container.presentation-mode .meeting-local-tile[style*="display: none"] {
  display: none !important;
}
.meeting-container.presentation-mode .meeting-screen-stage video { object-fit: contain; }

@media (max-width: 900px) {
  .meeting-container.presentation-mode .meeting-video-area {
    grid-template-columns: minmax(0, 1fr) 190px;
    gap: 8px;
    padding-left: 8px;
    padding-right: 8px;
  }
}
@media (max-width: 640px) {
  .meeting-container.presentation-mode .meeting-video-area {
    display: flex;
    flex-direction: column;
    padding: 54px 8px 84px;
  }
  .meeting-container.presentation-mode .meeting-screen-stage { flex: 1 1 auto; min-height: 0; }
  .meeting-container.presentation-mode .meeting-remote-grid {
    width: 100%;
    height: 108px;
    flex: 0 0 108px;
    grid-template-columns: repeat(3, minmax(100px, 1fr));
    grid-auto-rows: 100px;
    overflow-x: auto;
    overflow-y: hidden;
  }
  .meeting-container.presentation-mode .meeting-remote-tile { min-height: 100px; }
}

/* ── Final Teams-like interaction fixes ─────────────────────────────────
   These rules intentionally come last: older meeting styles were written for
   the original overlay layout and otherwise win at a few breakpoints. */

/* A solo camera/avatar is a stage, not an active participant tile. */
.meeting-video-area.meeting-solo .meeting-local-tile {
  border-color: var(--meeting-border) !important;
  box-shadow: none;
}
.meeting-video-area.meeting-solo .meeting-local-tile.talking {
  border-color: var(--meeting-emerald) !important;
  box-shadow: 0 0 0 1px rgba(78, 201, 176, .18);
}

/* Dock menus open upward and stay inside the viewport. */
.meeting-more-menu,
.meeting-leave-menu {
  top: auto !important;
  bottom: calc(100% + 8px);
  max-height: min(320px, calc(100vh - 120px));
  overflow-y: auto;
  overscroll-behavior: contain;
}
.meeting-more-menu { right: 0; }
.meeting-leave-menu { right: 0; }

/* Reactions float above the fixed control dock, never below the viewport. */
.meeting-reaction-stage {
  bottom: 108px;
  max-width: calc(100% - 24px);
  overflow: visible;
}

/* The opened chat is a real side pane: the stage/grid gets less width instead
   of being painted underneath the drawer. */
.meeting-container.chat-open .meeting-video-area {
  padding-right: 336px !important;
  box-sizing: border-box;
}
.meeting-container.chat-open .meeting-chat-drawer {
  top: 48px;
  bottom: 0;
  height: auto;
  width: min(320px, 34vw);
  max-width: 320px;
}
.meeting-container.chat-open.presentation-mode .meeting-video-area {
  grid-template-columns: minmax(0, 1fr) 0;
}
.meeting-container.chat-open.presentation-mode .meeting-remote-grid {
  display: none;
}

/* While presenting, the shared screen is the only media surface. The meeting
   chrome remains available so the presenter can stop sharing, chat, or leave. */
.meeting-container.screen-share-clean .meeting-video-area {
  display: block;
   padding: 72px 16px 92px !important;
  background: #050505;
}
.meeting-container.screen-share-clean .meeting-screen-stage {
  position: relative;
  inset: auto;
  width: 100%;
  height: 100%;
  min-height: 0;
  border: 1px solid rgba(255,255,255,.1);
  border-radius: 10px;
}
.meeting-container.screen-share-clean .meeting-remote-grid,
.meeting-container.screen-share-clean .meeting-local-tile,
.meeting-container.screen-share-clean .meeting-stage-controls,
.meeting-container.screen-share-clean .meeting-spotlight-exit {
  display: none !important;
}

/* Stable gallery geometry: cells share the available width/height and never
   retain the old fixed tile dimensions when a participant joins or leaves. */
.meeting-remote-grid.gallery {
  width: 100%;
  height: 100%;
  min-width: 0;
  min-height: 0;
  grid-auto-rows: minmax(0, 1fr);
  align-items: stretch;
  justify-items: stretch;
  overflow: hidden;
}
.meeting-remote-grid.gallery .meeting-video-tile,
.meeting-remote-grid.gallery .meeting-remote-tile {
  width: 100%;
  min-width: 0;
  min-height: 0;
  height: 100%;
  aspect-ratio: auto;
}

/* Deterministic Teams-style gallery breakpoints. The class is derived from
   the total participant count, so the existing tiles and the new tile always
   receive the same rows, columns, gaps, and available height. */
.meeting-container:not(.presentation-mode) .meeting-remote-grid.gallery {
  display: grid;
  gap: 10px;
  padding: 10px 16px;
  align-content: stretch;
  justify-content: stretch;
  grid-auto-flow: row;
}
.meeting-container:not(.presentation-mode) .meeting-remote-grid.gallery .meeting-local-tile {
  transition: none !important;
}
.meeting-container:not(.presentation-mode) .meeting-remote-grid.gallery.g2 {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  grid-template-rows: minmax(0, 1fr);
}
.meeting-container:not(.presentation-mode) .meeting-remote-grid.gallery.g3,
.meeting-container:not(.presentation-mode) .meeting-remote-grid.gallery.g4 {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  grid-template-rows: repeat(2, minmax(0, 1fr));
}
.meeting-container:not(.presentation-mode) .meeting-remote-grid.gallery.g3 > :nth-child(3) {
  grid-column: 1 / -1;
}
.meeting-container:not(.presentation-mode) .meeting-remote-grid.gallery.g5,
.meeting-container:not(.presentation-mode) .meeting-remote-grid.gallery.g6 {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  grid-template-rows: repeat(2, minmax(0, 1fr));
}
.meeting-container:not(.presentation-mode) .meeting-remote-grid.gallery.g7,
.meeting-container:not(.presentation-mode) .meeting-remote-grid.gallery.g8,
.meeting-container:not(.presentation-mode) .meeting-remote-grid.gallery.g9 {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  grid-template-rows: repeat(3, minmax(0, 1fr));
}
.meeting-container:not(.presentation-mode) .meeting-remote-grid.gallery.g10plus {
  grid-template-columns: repeat(4, minmax(0, 1fr));
  grid-template-rows: repeat(3, minmax(0, 1fr));
}

/* Dismissal is a real navigation action, not just a hidden overlay. */
.meeting-exit-card .exam-btn {
  min-width: 180px;
  cursor: pointer;
  pointer-events: auto;
}

/* A narrow viewport uses a compact bottom sheet for chat and reserves its
   height in the media area, keeping the controls and reactions reachable. */
@media (max-width: 760px) {
  .meeting-container.chat-open .meeting-video-area {
    padding-right: 0 !important;
    padding-bottom: min(48vh, 330px) !important;
  }
  .meeting-container.chat-open .meeting-chat-drawer {
    top: auto;
    right: 0;
    bottom: 82px;
    width: 100%;
    max-width: none;
    height: min(48vh, 330px);
    border-left: 0;
    border-top: 1px solid var(--meeting-border);
  }
  .meeting-more-menu,
  .meeting-leave-menu {
    right: 0;
    max-width: calc(100vw - 24px);
  }
  .meeting-reaction-stage { bottom: 94px; }
  .meeting-container.screen-share-clean .meeting-video-area {
    padding: 54px 8px 84px !important;
  }
}

/* Exit screen used after a clean leave/end transition. */
.meeting-exit-screen {
  position: fixed;
  inset: 0;
  z-index: 9100;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: radial-gradient(circle at 50% 25%, #182a2b 0, #080b0d 48%, #030405 100%);
}

/* Center meeting identity above the stage; it disappears in true fullscreen
   so presentation receives the complete display. */
.meeting-topbar-identity {
  position: absolute;
  top: 7px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  width: max-content;
  max-width: min(520px, calc(100vw - 360px));
  padding: 6px 16px 7px;
  background: rgba(24, 24, 24, .94);
  border: 1px solid rgba(255, 255, 255, .14);
  border-radius: 10px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, .46);
  pointer-events: auto;
  z-index: 2;
  opacity: 0;
  visibility: hidden;
  transform: translate(-50%, -8px);
  transition: opacity .18s ease, visibility .18s ease, transform .18s ease;
}
.meeting-container:not(.meeting-fullscreen) > .meeting-topbar:hover .meeting-topbar-identity,
.meeting-container.meeting-show-identity .meeting-topbar-identity {
  opacity: 1;
  visibility: visible;
  transform: translate(-50%, 0);
}
.meeting-room-title {
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: var(--meeting-text);
  font-size: 13px;
  font-weight: 600;
}
.meeting-topbar-identity .meeting-room-label {
  color: var(--meeting-text3);
  font-size: 10px;
}
.meeting-fullscreen .meeting-topbar-identity { display: none !important; }

/* Meeting notifications sit above the bottom control dock instead of
   covering the controls or the chat composer. */
body.meeting-active > .toast-container {
  bottom: 104px;
}

/* The fixed initial fullscreen geometry is inline on the container. Keep the
   minimized window deterministic even in browsers that prioritize it. */
.meeting-container.meeting-minimized {
  position: fixed !important;
  inset: auto 22px 22px auto !important;
  width: min(440px, calc(100vw - 32px)) !important;
  height: 260px !important;
  min-width: 0 !important;
  min-height: 0 !important;
  overflow: hidden !important;
}

/* Move the leave dock clear of the chat pane so the message composer remains
   clickable and never sits underneath the red leave control. */
.meeting-container.chat-open > .meeting-topbar .meeting-topbar-right {
  right: calc(min(320px, 34vw) + 24px);
}

@media (max-width: 760px) {
  .meeting-topbar-identity { max-width: 44vw; }
  body.meeting-active > .toast-container { bottom: 96px; }
  .meeting-container.chat-open > .meeting-topbar .meeting-topbar-right {
    right: 8px;
  }
}
.meeting-exit-card {
  width: min(460px, 100%);
  padding: 42px 34px 34px;
  text-align: center;
  background: rgba(22, 27, 29, .96);
  border: 1px solid rgba(78, 201, 176, .3);
  border-radius: 18px;
  box-shadow: 0 24px 80px rgba(0, 0, 0, .55);
}
.meeting-exit-mark {
  width: 58px;
  height: 58px;
  margin: 0 auto 20px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: rgba(78, 201, 176, .15);
  color: var(--meeting-emerald);
  font-size: 30px;
}
.meeting-exit-title {
  color: #f4f8f7;
  font-size: 21px;
  font-weight: 650;
}
.meeting-exit-message {
  margin: 10px 0 24px;
  color: var(--meeting-text2);
  font-size: 13px;
  line-height: 1.6;
}
.meeting-exit-card #meeting-exit-return-btn {
  display: block;
  width: min(240px, 100%);
  margin: 0 auto;
  text-align: center;
}

/* Full-bleed presentation: the shared display owns the entire meeting
   viewport. Meeting chrome stays layered above it, while contain preserves
   the complete shared resolution without cropping application content. */
.meeting-container.screen-share-clean .meeting-video-area {
  position: absolute;
  inset: 0;
  display: block;
  padding: 0 !important;
  background: #000;
}
.meeting-container.screen-share-clean .meeting-screen-stage {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: 0;
  border-radius: 0;
}
.meeting-container.screen-share-clean .meeting-screen-stage video {
  width: 100%;
  height: 100%;
  object-fit: contain;
  background: #000;
}
.meeting-container.screen-share-clean .meeting-screen-label {
  top: 72px;
  left: 20px;
}

/* ── Final meeting interaction/layout polish ──────────────────────────── */
.meeting-container > .meeting-topbar {
  overflow: visible;
}
.meeting-container > .meeting-topbar .meeting-topbar-left {
  position: relative;
  z-index: 5;
  gap: 10px;
  white-space: nowrap;
}
.meeting-container > .meeting-topbar .meeting-participant-count,
.meeting-container > .meeting-topbar .meeting-timer {
  flex: 0 0 auto;
  line-height: 22px;
}

/* Side panes begin at the meeting viewport edge and reserve their width from
   the media area, just like the Teams right rail. */
.meeting-container.participants-open .meeting-video-area,
.meeting-container.chat-open .meeting-video-area {
  padding-right: min(336px, calc(34vw + 16px)) !important;
  box-sizing: border-box;
}
.meeting-container .meeting-participants-panel,
.meeting-container .meeting-chat-drawer {
  top: 0;
  bottom: 0;
  height: auto;
  width: min(320px, 34vw);
  max-width: 320px;
  z-index: 42;
}
.meeting-container .meeting-panel-header,
.meeting-container .meeting-chat-header {
  min-height: 48px;
}
.meeting-participant-search-wrap {
  padding: 0 14px 10px;
  flex-shrink: 0;
}
.meeting-participant-search {
  width: 100%;
  height: 32px;
  box-sizing: border-box;
  padding: 0 10px;
  color: var(--meeting-text);
  background: rgba(0, 0, 0, .28);
  border: 1px solid var(--meeting-border);
  border-radius: 6px;
  outline: none;
  font: inherit;
  font-size: 12px;
}
.meeting-participant-search:focus {
  border-color: var(--meeting-emerald);
  box-shadow: 0 0 0 2px rgba(78, 201, 176, .12);
}
.meeting-participant-media-status {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 18px;
  height: 18px;
  color: var(--meeting-emerald);
}
.meeting-participant-media-status.is-off {
  color: var(--meeting-red);
}
.meeting-participant-media-status .meeting-slash {
  stroke-width: 2.2;
}
.meeting-participant-chat {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  padding: 0;
  color: var(--meeting-text2);
  background: transparent;
  border: 0;
  border-radius: 5px;
  cursor: pointer;
}
.meeting-participant-chat:hover {
  color: var(--meeting-emerald);
  background: rgba(78, 201, 176, .12);
}
.meeting-chat-title-wrap {
  min-width: 0;
  display: flex;
  align-items: baseline;
  gap: 7px;
  overflow: hidden;
}
.meeting-chat-target {
  max-width: 130px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: var(--meeting-emerald);
  font-size: 11px;
}
.meeting-chat-target-clear {
  margin-left: auto;
  padding: 3px 7px;
  color: var(--meeting-text2);
  background: transparent;
  border: 1px solid var(--meeting-border);
  border-radius: 5px;
  font: inherit;
  font-size: 10px;
  cursor: pointer;
}
.meeting-chat-target-clear:hover {
  color: var(--meeting-text);
  border-color: var(--meeting-emerald);
}
.meeting-chat-header .meeting-chat-title {
  flex: 0 0 auto;
}
.meeting-chat-recipient-label {
  margin-left: 10px;
  color: var(--meeting-text3);
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: .45px;
}
.meeting-chat-recipient {
  min-width: 108px;
  max-width: 145px;
  height: 28px;
  margin-left: 2px;
  padding: 0 8px;
  color: var(--meeting-text);
  background: rgba(0, 0, 0, .28);
  border: 1px solid var(--meeting-border);
  border-radius: 6px;
  outline: none;
  font: inherit;
  font-size: 11px;
  cursor: pointer;
  color-scheme: dark;
  background: #111214;
}

/* Warm night-light palette: preserves the existing dark theme while removing
   the cold near-black/blue cast that becomes harsh during evening use. */
:root {
  --bg:         #151514;
  --bg2:        #1d1c1a;
  --bg3:        #25231f;
  --bg4:        #302d28;
  --bg5:        #3a3630;
  --actbar:     #191816;
  --border:     #37332d;
  --border2:    #4a443b;
  --text:       #e3ddd3;
  --text2:      #bdb4a8;
  --text3:      #91897e;
  --hl:         rgba(77, 170, 242, .30);
  --hl2:        #373028;
  --blue:       #4DAAF2;
  --statusbar:  #191816;
}

.meeting-chat-recipient option {
  color: #dedede;
  background: #1b1d20;
}
.meeting-chat-recipient:focus,
.meeting-chat-recipient:hover {
  border-color: var(--meeting-emerald);
}
.meeting-chat-header > .meeting-icon-btn {
  margin-left: auto;
  flex: 0 0 auto;
}
.meeting-chat-msg .msg-meta {
  display: block;
  margin: 1px 0 4px;
  color: var(--meeting-text3);
  font-size: 9px;
  font-weight: 400;
  letter-spacing: .15px;
}
.meeting-chat-msg.from-me .msg-meta {
  color: rgba(78, 201, 176, .75);
}

/* Keep the stage inside the viewport even when panels or the browser viewport
   changes size while a participant joins. */
.meeting-container:not(.meeting-minimized) .meeting-video-area {
  min-width: 0;
  min-height: 0;
  overflow: hidden;
}
.meeting-container:not(.meeting-minimized) .meeting-remote-grid,
.meeting-container:not(.meeting-minimized) .meeting-screen-stage {
  min-width: 0;
  min-height: 0;
  box-sizing: border-box;
}
.meeting-container.screen-share-clean.chat-open .meeting-screen-stage,
.meeting-container.screen-share-clean.participants-open .meeting-screen-stage {
  right: min(320px, 34vw);
}

/* Match the Participants rail exactly. This selector intentionally matches
   the older, more-specific chat-open rule so the drawer starts at the meeting
   viewport edge instead of retaining the old 48px top offset. */
.meeting-container.chat-open .meeting-chat-drawer {
  top: 0;
  right: 0;
  bottom: 0;
  height: auto;
  width: min(320px, 34vw);
  max-width: 320px;
  z-index: 42;
}

/* Teams-style contextual chrome: the red leave control is available when the
   pointer reaches the lower-right meeting edge, without covering media. */
.meeting-container > .meeting-topbar .meeting-topbar-right {
  opacity: 0;
  pointer-events: none;
  transition: opacity .18s ease;
}
.meeting-container.meeting-show-leave > .meeting-topbar .meeting-topbar-right,
.meeting-container > .meeting-topbar .meeting-topbar-right:hover {
  opacity: 1;
  pointer-events: auto;
}

/* Codexa editor sharing is an application-level read-only collaboration view.
   It deliberately does not use browser display capture, so other tabs and
   desktop content can never leak into the meeting. */
.meeting-container.editor-share-active .meeting-video-area {
  display: flex;
  align-items: stretch;
  justify-content: stretch;
  padding: 16px;
  background: #101112;
}

.meeting-container.editor-share-active .meeting-editor-stage {
  display: flex !important;
  flex: 1 1 auto;
  min-width: 0;
  min-height: 0;
  flex-direction: column;
  overflow: hidden;
  border: 1px solid #3a3d40;
  border-radius: 10px;
  background: #1e1f21;
  box-shadow: 0 14px 38px rgba(0, 0, 0, .34);
}

.meeting-editor-share-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 46px;
  padding: 0 16px;
  color: #e6e6e6;
  background: #292b2e;
  border-bottom: 1px solid #3a3d40;
}

.meeting-editor-share-heading {
  display: flex;
  align-items: center;
  min-width: 0;
  gap: 9px;
  font-size: 13px;
  font-weight: 650;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.meeting-editor-share-live-dot {
  width: 8px;
  height: 8px;
  flex: 0 0 auto;
  border-radius: 50%;
  background: #73c991;
  box-shadow: 0 0 0 3px rgba(115, 201, 145, .12);
}

.meeting-editor-share-status {
  flex: 0 0 auto;
  color: #a6aaae;
  font-size: 11px;
  letter-spacing: .2px;
}

.meeting-editor-share-tabs {
  display: flex;
  min-height: 34px;
  align-items: stretch;
  gap: 1px;
  padding: 0 10px;
  overflow: hidden;
  background: #242629;
  border-bottom: 1px solid #35383c;
}

.meeting-editor-share-tab {
  max-width: 220px;
  padding: 9px 13px 8px;
  overflow: hidden;
  color: #9da2a7;
  font-family: 'Segoe UI', system-ui, sans-serif;
  font-size: 11px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.meeting-editor-share-tab.active {
  color: #f0f0f0;
  background: #1e1f21;
  box-shadow: inset 0 2px 0 #9b9fa4;
}

.meeting-editor-share-meta-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  min-height: 32px;
  padding: 0 16px;
  color: #8f9499;
  background: #202225;
  border-bottom: 1px solid #303337;
  font-size: 11px;
}

.meeting-editor-share-readonly {
  padding: 3px 7px;
  color: #b7bbc0;
  border: 1px solid #4a4e53;
  border-radius: 4px;
  font-size: 9px;
  font-weight: 700;
  letter-spacing: .7px;
}

.meeting-editor-share-code {
  flex: 1 1 auto;
  min-height: 0;
  margin: 0;
  padding: 14px 0 22px;
  overflow: auto;
  color: #d6d7d8;
  background: #1e1f21;
  font-family: Consolas, 'JetBrains Mono', monospace;
  font-size: 13px;
  line-height: 1.65;
  tab-size: 4;
  white-space: pre;
  counter-reset: editor-share-line;
}

.meeting-editor-share-line {
  display: block;
  min-height: 1.65em;
  padding: 0 24px 0 68px;
  position: relative;
  counter-increment: editor-share-line;
}

.meeting-editor-share-line::before {
  position: absolute;
  left: 0;
  width: 52px;
  padding-right: 14px;
  color: #666b70;
  content: attr(data-line);
  text-align: right;
  user-select: none;
}

.meeting-editor-share-line.active {
  background: rgba(255, 255, 255, .055);
}

.meeting-editor-share-line.active::before {
  color: #bfc3c7;
}

.meeting-editor-share-omitted {
  color: #858a8f;
  font-style: italic;
  background: rgba(255, 255, 255, .025);
}

.meeting-container.editor-share-active .meeting-remote-grid,
.meeting-container.editor-share-active .meeting-local-tile,
.meeting-container.editor-share-active .meeting-screen-stage {
  display: none !important;
}

.meeting-editor-share-btn.active {
  color: #e3e5e7;
  background: #45484c;
  border-color: #8d9297;
  box-shadow: 0 0 0 2px rgba(190, 194, 198, .12);
}

@media (max-width: 760px) {
  .meeting-container.editor-share-active .meeting-video-area {
    padding: 8px;
  }
  .meeting-editor-share-toolbar {
    padding: 0 10px;
  }
  .meeting-editor-share-status {
    display: none;
  }
  .meeting-editor-share-line {
    padding-left: 54px;
  }
}

/* When editor sharing is active, participants use the real Codexa workspace
   instead of a second meeting-only editor surface. */
.meeting-editor-follow-banner {
  min-height: 46px;
  display: none;
  align-items: center;
  gap: 10px;
  flex: 0 0 auto;
  padding: 0 16px;
  color: #f2f4f5;
  background: linear-gradient(90deg, #202a24 0%, #252a2d 52%, #202326 100%);
  border-bottom: 2px solid #75b889;
  box-shadow: 0 2px 12px rgba(0, 0, 0, .28);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: .1px;
  position: relative;
  z-index: 4;
}

.meeting-editor-follow-dot {
  width: 7px;
  height: 7px;
  flex: 0 0 auto;
  border-radius: 50%;
  background: #8fc7a0;
  box-shadow: 0 0 0 3px rgba(143, 199, 160, .12);
}

.meeting-editor-follow-file {
  min-width: 0;
  overflow: hidden;
  color: #b5c0b8;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.meeting-editor-follow-banner button {
  margin-left: auto;
  flex: 0 0 auto;
  min-height: 32px;
  padding: 6px 14px;
  color: #111714;
  background: #a9e2b7;
  border: 1px solid #d0f3d7;
  border-radius: 6px;
  cursor: pointer;
  font: inherit;
  font-weight: 700;
  box-shadow: 0 1px 4px rgba(0, 0, 0, .3);
}

.meeting-editor-follow-banner button:hover {
  color: #08100b;
  background: #c4f0cc;
  border-color: #effff1;
  transform: translateY(-1px);
}

/* While the shared workspace is the active surface, prevent navigation into
   another meeting or the exam portal until the user returns to the call. */
body.meeting-editor-following #act-exam,
body.meeting-editor-following #btn-join-meeting {
  display: none !important;
}

body.meeting-editor-following #ide-panel {
  position: relative;
}

body.meeting-editor-following #raw-editor {
  caret-color: transparent;
}

/* CodeMirror uses its own fixed colors in a few places, so keep the editor
   on the same warm night-light surface as the surrounding application. */
.CodeMirror,
.CodeMirror-scroll,
.CodeMirror-gutters,
.sql-notebook-cell .CodeMirror,
.sql-notebook-cell .CodeMirror-gutters {
  background: #1d1c1a !important;
}

.CodeMirror {
  color: #e3ddd3 !important;
}

.CodeMirror-gutters {
  border-right-color: #37332d !important;
}

.CodeMirror-linenumber {
  color: #91897e !important;
}

.CodeMirror-activeline-background {
  background: #282521 !important;
}

.CodeMirror-selected,
.CodeMirror-focused .CodeMirror-selected {
  background: rgba(77, 170, 242, .34) !important;
}

.CodeMirror-hints {
  background: #25231f !important;
  border-color: #4a443b !important;
}

.CodeMirror-hint {
  color: #e3ddd3 !important;
}

li.CodeMirror-hint-active {
  background: rgba(77, 170, 242, .42) !important;
  color: #fff7eb !important;
}

.sql-cell-input,
.sql-notebook-cell .CodeMirror {
  background: #1d1c1a !important;
  color: #e3ddd3 !important;
}

.sql-notebook-cell .CodeMirror-gutters {
  border-right-color: #37332d !important;
}

.app-alert-overlay[hidden] { display: none; }
.app-alert-overlay {
  position: fixed;
  inset: 0;
  z-index: 20000;
  display: grid;
  place-items: center;
  padding: 20px;
  background: rgba(0, 0, 0, .58);
  backdrop-filter: blur(3px);
}
.app-alert-card {
  width: min(420px, 100%);
  padding: 18px;
  color: var(--text);
  background: #25231f;
  border: 1px solid var(--border2);
  border-top: 3px solid #4DAAF2;
  border-radius: 8px;
  box-shadow: 0 18px 60px rgba(0, 0, 0, .45);
}
.app-alert-title { font-size: 13px; font-weight: 700; margin-bottom: 10px; }
.app-alert-message { color: var(--text2); font-size: 12px; line-height: 1.55; white-space: pre-wrap; }
.app-alert-actions { display: flex; justify-content: flex-end; margin-top: 18px; }
.app-alert-ok {
  min-width: 72px;
  padding: 7px 14px;
  color: #f5fbff;
  background: rgba(77, 170, 242, .75);
  border: 1px solid #80c5f4;
  border-radius: 5px;
  cursor: pointer;
  font-weight: 700;
}
.app-alert-ok:hover { background: rgba(77, 170, 242, .92); }

@media (max-width: 760px) {
  .meeting-container.participants-open .meeting-video-area,
  .meeting-container.chat-open .meeting-video-area {
    padding-right: 0 !important;
  }
  .meeting-container .meeting-participants-panel {
    width: 100%;
    max-width: none;
  }
  .meeting-container.chat-open .meeting-chat-drawer {
    top: auto;
    bottom: 82px;
    width: 100%;
    max-width: none;
    height: min(48vh, 330px);
  }
  .meeting-chat-recipient {
    min-width: 92px;
    max-width: 118px;
  }
  .meeting-chat-recipient-label {
    display: none;
  }
  .meeting-container.screen-share-clean.chat-open .meeting-screen-stage {
    right: 0;
    bottom: calc(min(48vh, 330px) + 82px);
  }
  .meeting-container > .meeting-topbar .meeting-topbar-right {
    opacity: 1;
    pointer-events: auto;
  }
}


/* ── Exam Modal (themed alert/confirm) ─────────────────────────────── */
.exam-modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 10000;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0, 0, 0, 0.65);
  font-family: 'JetBrains Mono', monospace;
}

.exam-modal {
  width: min(480px, calc(100vw - 40px));
  max-height: min(70vh, 560px);
  display: flex;
  flex-direction: column;
  background: var(--bg2);
  border: 1px solid var(--border2);
  border-radius: 8px;
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.6);
  animation: exam-modal-in 140ms ease-out;
}

@keyframes exam-modal-in {
  from { opacity: 0; transform: translateY(8px) scale(0.98); }
  to   { opacity: 1; transform: none; }
}

.exam-modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 16px;
  border-bottom: 1px solid var(--border);
  background: var(--bg3);
  border-radius: 8px 8px 0 0;
}

.exam-modal-title {
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.6px;
  text-transform: uppercase;
  color: var(--green2);
  display: flex;
  align-items: center;
  gap: 8px;
}

.exam-modal-title::before {
  content: '';
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--green2);
  flex: 0 0 auto;
}

.exam-modal.danger .exam-modal-title { color: var(--red); }
.exam-modal.danger .exam-modal-title::before { background: var(--red); }

.exam-modal-close {
  border: none;
  background: transparent;
  color: var(--text3);
  font-size: 18px;
  line-height: 1;
  cursor: pointer;
  padding: 2px 6px;
  border-radius: 4px;
}
.exam-modal-close:hover { color: var(--text); background: var(--bg4); }

.exam-modal-body {
  padding: 16px;
  overflow-y: auto;
  font-size: 12px;
  line-height: 1.6;
  color: var(--text);
  white-space: pre-wrap;
  word-break: break-word;
}

.exam-modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  padding: 12px 16px;
  border-top: 1px solid var(--border);
  background: var(--bg3);
  border-radius: 0 0 8px 8px;
}

.exam-modal-btn {
  font-family: 'JetBrains Mono', monospace;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.4px;
  padding: 7px 16px;
  border-radius: 4px;
  border: 1px solid var(--border2);
  background: var(--bg4);
  color: var(--text);
  cursor: pointer;
  transition: background 120ms, border-color 120ms;
}
.exam-modal-btn:hover { background: var(--bg5); border-color: var(--text3); }

.exam-modal-btn.primary {
  background: var(--green2);
  border-color: var(--green2);
  color: #000;
}
.exam-modal-btn.primary:hover { filter: brightness(1.1); }

.exam-modal-btn.danger {
  background: var(--red);
  border-color: var(--red);
  color: #000;
}
.exam-modal-btn.danger:hover { filter: brightness(1.08); }
