/* Lab chrome: theme + fullscreen controls (shared across all labs) */

.lab-chrome-btn {
  min-width: 40px;
  min-height: 40px;
  padding: 0.4rem 0.7rem !important;
  display: inline-flex !important;
  align-items: center;
  justify-content: center;
  gap: 0.35rem;
  font-size: 0.78rem !important;
  letter-spacing: 0.01em;
}
.lab-chrome-btn .lab-chrome-ico {
  font-size: 1rem;
  line-height: 1;
  font-style: normal;
}
.lab-chrome-btn .lab-chrome-label {
  display: none;
}
@media (min-width: 900px) {
  .lab-chrome-btn .lab-chrome-label { display: inline; }
  .lab-chrome-btn { padding: 0.45rem 0.85rem !important; }
}

.app:fullscreen,
.app:-webkit-full-screen {
  width: 100vw;
  height: 100vh;
  height: 100dvh;
  max-height: 100dvh;
  background: var(--black);
}
html[data-theme="light"] .app:fullscreen,
html[data-theme="light"] .app:-webkit-full-screen {
  background: #f3f4f6;
}

/* ---------- Light mode (high-contrast text) ---------- */
html[data-theme="light"] {
  color-scheme: light;
}

html[data-theme="light"] body {
  background: #f3f4f6;
  color: #111827;
}

html[data-theme="light"] .topbar {
  background: #ffffff;
  color: #111827;
  border-bottom: 1px solid #d1d5db;
}

html[data-theme="light"] .topbar .btn {
  background: #111827;
  color: #ffffff;
}
html[data-theme="light"] .topbar .btn.ok {
  background: #111827;
  color: #ffffff;
}
html[data-theme="light"] .topbar .btn.ghost {
  background: #ffffff;
  color: #111827;
  border: 1px solid #9ca3af;
}
html[data-theme="light"] .topbar .btn.ghost:hover {
  background: #f3f4f6;
  opacity: 1;
}
html[data-theme="light"] .topbar .btn.accent {
  background: #8b1e1e;
  color: #ffffff;
}

html[data-theme="light"] .sidebar,
html[data-theme="light"] .ai-panel {
  background: #ffffff;
  border-color: #d1d5db;
  color: #111827;
}

html[data-theme="light"] .main {
  background: #f3f4f6;
  color: #111827;
}

html[data-theme="light"] .sidebar h2,
html[data-theme="light"] .ai-panel h2,
html[data-theme="light"] .panel-head h2 {
  color: #111827;
}

html[data-theme="light"] .project-item {
  color: #111827 !important;
  background: #ffffff !important;
  border-color: #d1d5db !important;
}
html[data-theme="light"] .project-item:hover {
  background: #f9fafb !important;
  border-color: #9ca3af !important;
}
html[data-theme="light"] .project-item.active {
  background: #eef2ff !important;
  border-color: #6366f1 !important;
}
html[data-theme="light"] .project-item strong,
html[data-theme="light"] .project-item.active strong {
  color: #111827;
}
html[data-theme="light"] .project-item span {
  color: #4b5563;
}

html[data-theme="light"] .project-head h1 {
  color: #111827;
}
html[data-theme="light"] .project-head p,
html[data-theme="light"] .hint {
  color: #374151;
}

html[data-theme="light"] .btn.ghost {
  color: #111827;
  border-color: #9ca3af;
  background: #ffffff;
}
html[data-theme="light"] .btn.icon-btn {
  color: #111827;
  border-color: #9ca3af;
  background: #ffffff;
}
html[data-theme="light"] .btn.ok {
  background: #111827;
  color: #ffffff;
}
html[data-theme="light"] .projects-trigger {
  color: #111827 !important;
  border-color: #9ca3af !important;
  background: #ffffff !important;
}

html[data-theme="light"] .lab-footer .btn.mark-done {
  color: #111827;
  border-color: #9ca3af;
}

html[data-theme="light"] .cell {
  background: #ffffff;
  border-color: #d1d5db;
  color: #111827;
}
html[data-theme="light"] .step-title,
html[data-theme="light"] .cell h3 {
  color: #111827;
}
html[data-theme="light"] .step-md {
  background: #f8fafc !important;
  border-bottom-color: #d1d5db !important;
  color: #374151 !important;
}
html[data-theme="light"] .step-md h1,
html[data-theme="light"] .step-md h2,
html[data-theme="light"] .step-md h3,
html[data-theme="light"] .step-md h4 {
  color: #111827 !important;
}
html[data-theme="light"] .step-md p {
  color: #374151 !important;
}
html[data-theme="light"] .step-md strong {
  color: #111827 !important;
}
html[data-theme="light"] .step-md code {
  background: #e5e7eb !important;
  color: #111827 !important;
}
html[data-theme="light"] .cell-toolbar {
  background: #f3f4f6 !important;
  border-bottom-color: #d1d5db !important;
}
html[data-theme="light"] .cell-meta,
html[data-theme="light"] .cell-label {
  color: #4b5563 !important;
}
html[data-theme="light"] .cell textarea.code-source {
  background: #f8fafc !important;
  color: #111827 !important;
}

html[data-theme="light"] .editor-shell,
html[data-theme="light"] .code-wrap {
  background: #f8fafc !important;
  border-color: #d1d5db !important;
}

html[data-theme="light"] .CodeMirror,
html[data-theme="light"] .CodeMirror-scroll,
html[data-theme="light"] .CodeMirror-sizer,
html[data-theme="light"] .CodeMirror-lines {
  background: #f8fafc !important;
  color: #111827 !important;
}
html[data-theme="light"] .CodeMirror-gutters {
  background: #eef2f7 !important;
  border-right: 1px solid #d1d5db !important;
}
html[data-theme="light"] .CodeMirror-linenumber {
  color: #6b7280 !important;
}
html[data-theme="light"] .CodeMirror-cursor {
  border-left-color: #111827 !important;
}
html[data-theme="light"] .CodeMirror-selected,
html[data-theme="light"] .CodeMirror-focused .CodeMirror-selected {
  background: #c7d2fe !important;
}
/* Cover both default + leftover material-darker class names in light mode */
html[data-theme="light"] .cm-s-default .cm-keyword,
html[data-theme="light"] .cm-s-material-darker .cm-keyword { color: #7c3aed !important; }
html[data-theme="light"] .cm-s-default .cm-string,
html[data-theme="light"] .cm-s-material-darker .cm-string { color: #047857 !important; }
html[data-theme="light"] .cm-s-default .cm-number,
html[data-theme="light"] .cm-s-material-darker .cm-number { color: #c2410c !important; }
html[data-theme="light"] .cm-s-default .cm-comment,
html[data-theme="light"] .cm-s-material-darker .cm-comment { color: #6b7280 !important; }
html[data-theme="light"] .cm-s-default .cm-builtin,
html[data-theme="light"] .cm-s-default .cm-def,
html[data-theme="light"] .cm-s-material-darker .cm-builtin,
html[data-theme="light"] .cm-s-material-darker .cm-def { color: #1d4ed8 !important; }
html[data-theme="light"] .cm-s-default .cm-variable,
html[data-theme="light"] .cm-s-material-darker .cm-variable { color: #111827 !important; }
html[data-theme="light"] .cm-s-default .cm-operator,
html[data-theme="light"] .cm-s-material-darker .cm-operator { color: #0e7490 !important; }
html[data-theme="light"] .CodeMirror pre,
html[data-theme="light"] .CodeMirror .CodeMirror-code {
  color: #111827 !important;
}

html[data-theme="light"] .output {
  background: #f8fafc !important;
  border-top-color: #d1d5db !important;
  color: #1f2937 !important;
}
html[data-theme="light"] .output .ok { color: #1f2937 !important; }
html[data-theme="light"] .output .err { color: #b91c1c !important; }
html[data-theme="light"] .output .muted,
html[data-theme="light"] .output .empty {
  color: #6b7280 !important;
}
html[data-theme="light"] .output img,
html[data-theme="light"] .output canvas {
  background: #ffffff;
  border: 1px solid #d1d5db;
}

html[data-theme="light"] .msg {
  background: #f3f4f6;
  color: #111827;
  border: 1px solid #e5e7eb;
}
html[data-theme="light"] .msg.user {
  background: #fff7ed;
  border-color: #fed7aa;
}
html[data-theme="light"] .msg.assistant {
  background: #eff6ff;
  border-color: #bfdbfe;
}
html[data-theme="light"] .msg .who {
  color: #4b5563;
}
html[data-theme="light"] .msg pre {
  background: #f8fafc !important;
  color: #111827 !important;
  border: 1px solid #d1d5db;
}
html[data-theme="light"] .ai-compose textarea,
html[data-theme="light"] .ai-settings input,
html[data-theme="light"] .ai-settings textarea {
  background: #ffffff;
  color: #111827;
  border: 1px solid #9ca3af;
}
html[data-theme="light"] .ai-compose textarea::placeholder,
html[data-theme="light"] .ai-settings input::placeholder {
  color: #6b7280;
}
html[data-theme="light"] .ai-note,
html[data-theme="light"] .ai-settings summary,
html[data-theme="light"] .ai-settings label {
  color: #374151;
}

html[data-theme="light"] .mobile-nav {
  background: #ffffff;
  border-top: 1px solid #d1d5db;
}
html[data-theme="light"] .mob-tab {
  color: #4b5563;
}
html[data-theme="light"] .mob-tab.active {
  color: #111827;
}

html[data-theme="light"] .backdrop {
  background: rgba(17, 24, 39, 0.45);
}

html[data-theme="light"] .sql-table th {
  background: #e5e7eb;
  color: #111827;
}
html[data-theme="light"] .sql-table td {
  color: #1f2937;
  border-color: #d1d5db;
}
html[data-theme="light"] .sql-meta {
  color: #4b5563;
}

/* Explain tooltips remain readable on light pages */
html[data-theme="light"] .lab-explain-tip {
  background: linear-gradient(160deg, #ffffff 0%, #f8fafc 55%, #f3f4f6 100%);
  color: #111827;
  border: 1px solid #d1d5db;
  box-shadow:
    0 12px 40px rgba(17, 24, 39, 0.18),
    0 0 0 1px rgba(139, 30, 30, 0.12);
}
html[data-theme="light"] .lab-explain-tip-title {
  color: #111827;
}
html[data-theme="light"] .lab-explain-tip-body,
html[data-theme="light"] .lab-explain-tip p {
  color: #374151;
}
html[data-theme="light"] .lab-explain-token-hit {
  background: rgba(139, 30, 30, 0.16) !important;
  box-shadow: 0 0 0 1px rgba(139, 30, 30, 0.28);
}

/* Career banner / progress chips if present */
html[data-theme="light"] .career-banner,
html[data-theme="light"] .progress-chip {
  color: #111827;
}
