/* ============================================================
   NEXORA · Screen / Code Lab
   Screen-specific layout only — chrome comes from
   components/workspace-toolbar/workspace.css
   ============================================================ */

.cl-project-select {
  width: auto;
  min-width: 170px;
  padding: 0.45rem 0.8rem;
  font-family: var(--font-mono);
  font-size: 0.78rem;
  border-radius: var(--radius-sm);
}

/* Editor region */
.cl-editor-host {
  flex: 1;
  min-height: 0;
  position: relative;
}

.cl-editor {
  position: absolute;
  inset: 0;
}

/* ---------- File tree ----------------------------------------- */

.cl-tree {
  display: grid;
  gap: 1px;
}

.cl-node {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  width: 100%;
  padding: 0.4rem 0.5rem;
  border-radius: var(--radius-xs);
  font-family: var(--font-mono);
  font-size: 0.76rem;
  color: var(--text-2);
  text-align: left;
  cursor: pointer;
  transition: color var(--dur-fast), background var(--dur-fast);
}

.cl-node:hover {
  color: var(--text-1);
  background: rgba(255, 255, 255, 0.06);
}

.cl-node.is-active {
  color: var(--text-1);
  background: rgba(106, 99, 255, 0.16);
}

.cl-node .icon {
  width: 0.95em;
  height: 0.95em;
  flex: none;
}

.cl-node .fname {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.cl-node .fdot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--warning);
  flex: none;
}

.cl-node-actions {
  display: none;
  gap: 0.1rem;
}

.cl-node:hover .cl-node-actions {
  display: flex;
}

.cl-folder-label {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.4rem 0.5rem 0.25rem;
  font-family: var(--font-mono);
  font-size: 0.66rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-3);
}

/* File-type accents & asset icons */
img.asset-icon {
  display: inline-block;
  vertical-align: middle;
  object-fit: contain;
  flex-shrink: 0;
}

.ft-html { color: #ff8fa3; }
.ft-css  { color: #2fd2f2; }
.ft-js   { color: #ffc94d; }
.ft-py   { color: #38bdf8; }
.ft-json { color: #b78cff; }
.ft-cpp  { color: #a78bfa; }
.ft-md   { color: var(--text-2); }

/* ---------- Search pane --------------------------------------- */

.cl-search-box {
  margin-bottom: 0.6rem;
}

.cl-search-box .input {
  padding: 0.5rem 0.7rem;
  font-family: var(--font-mono);
  font-size: 0.76rem;
}

.cl-hit {
  display: block;
  width: 100%;
  padding: 0.45rem 0.5rem;
  border-radius: var(--radius-xs);
  font-family: var(--font-mono);
  font-size: 0.72rem;
  color: var(--text-2);
  text-align: left;
  cursor: pointer;
}

.cl-hit:hover {
  background: rgba(255, 255, 255, 0.06);
  color: var(--text-1);
}

.cl-hit b {
  color: var(--accent-2);
  font-weight: 500;
}

.cl-hit mark {
  background: rgba(255, 201, 77, 0.28);
  color: inherit;
  border-radius: 2px;
}

/* ---------- Snippets / help ------------------------------------ */

.cl-snip-group {
  font-family: var(--font-mono);
  font-size: 0.64rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-3);
  padding: 0.6rem 0.4rem 0.2rem;
  border-top: 1px solid rgba(255, 255, 255, 0.05);
  margin-top: 0.4rem;
}

.cl-snip-group:first-child {
  border-top: 0;
  margin-top: 0;
  padding-top: 0;
}

.cl-snip {
  display: grid;
  gap: 0.2rem;
  width: 100%;
  padding: 0.55rem 0.6rem;
  border-radius: var(--radius-sm);
  text-align: left;
  cursor: pointer;
  transition: background var(--dur-fast);
}

.cl-snip:hover {
  background: rgba(255, 255, 255, 0.06);
}

.cl-snip b {
  font-family: var(--font-display);
  font-size: 0.82rem;
  color: var(--text-1);
}

.cl-snip span {
  font-family: var(--font-mono);
  font-size: 0.66rem;
  color: var(--text-3);
}

.cl-keys {
  display: grid;
  gap: 0.45rem;
}

.cl-keys div {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  font-size: 0.76rem;
  color: var(--text-2);
}

.cl-keys kbd {
  font-family: var(--font-mono);
  font-size: 0.66rem;
  padding: 0.15rem 0.4rem;
  border-radius: var(--radius-xs);
  background: rgba(255, 255, 255, 0.09);
  color: var(--text-1);
  white-space: nowrap;
}

/* ---------- Preview + problems ---------------------------------- */

.cl-preview {
  width: 100%;
  height: 100%;
  border: 0;
  background: #fff;
  display: block;
}

.cl-problems {
  height: 100%;
  overflow: auto;
  padding: 0.5rem;
}

.cl-problem {
  display: flex;
  align-items: flex-start;
  gap: 0.6rem;
  padding: 0.5rem 0.6rem;
  border-radius: var(--radius-xs);
  font-family: var(--font-mono);
  font-size: 0.74rem;
  color: var(--text-2);
  cursor: pointer;
}

.cl-problem:hover {
  background: rgba(255, 255, 255, 0.05);
}

.cl-problem .icon {
  width: 0.95em;
  height: 0.95em;
  margin-top: 0.15rem;
  flex: none;
}

.cl-problem.error { color: var(--danger); }
.cl-problem.warn { color: var(--warning); }
.cl-problem.info { color: var(--text-3); }

.cl-problem .where {
  margin-left: auto;
  color: var(--text-3);
  white-space: nowrap;
}

/* Inline rename input */
.cl-rename {
  width: 100%;
  padding: 0.3rem 0.4rem;
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: var(--text-1);
  background: rgba(255, 255, 255, 0.1);
  border: 0;
  border-radius: var(--radius-xs);
  outline: none;
}

.cl-rename:focus {
  box-shadow: 0 0 0 2px var(--accent);
}

@media (max-width: 900px) {
  .cl-project-select {
    min-width: 130px;
  }
}
