/*.cg-workspace {
  display: grid;
  grid-template-columns: 1fr 1fr;
  height: 90%;
}
*/

/* FIX CodeMirror spacing */

.CodeMirror pre {
  line-height: 1.4;
}


.CodeMirror {
  height: 100%;
  font-size: 14px;
  border-radius: 0;
  line-height: normal;
}

/* ===== MODAL BASE ===== */
#cg-modal {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.75);
  display: none;
  z-index: 99999;
  backdrop-filter: blur(6px);
}

#cg-modal.show {
  display: flex;
}

/* ===== MODAL BOX ===== */
.cg-modal-box {
  background: #0f172a;
  color: #e5e7eb;
  width: 95%;
  max-width: 1100px;
  height: 90%;
  margin: auto;
  border-radius: 16px;
  overflow: hidden;
  box-shadow: 0 30px 80px rgba(0,0,0,.6);
  display: flex;
  flex-direction: column;
}

/* ===== TOOLBAR ===== */
.cg-toolbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap:8px;
  padding: 10px 14px;
  background: #020617;
  border-bottom: 1px solid #1e293b;
  
}
/* === Menu : Run, New Tab, Copy, Reset, Clear ===*/
.cg-toolbar button {
  background: #2d2d2d/*#2563eb*/ ;
  color: #fff;
  border: none;
  padding: 6px 12px;
  margin-right: 6px;
  margin-bottom: 4px;
  border-radius: 8px;
  font-size: 13px;
  cursor: pointer;
}

.cg-toolbar button:hover {
  background: #3d3d3d/*#1d4ed8*/;
}

#cg-close {
  background: #ef4444;
}

/* ===== EDITOR ===== */
#cg-editor {
  flex: 1;
  width: 100%;
  background: #020617;
  color: #e5e7eb;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 14px;
  line-height: 1.6;
  padding: 14px;
  border: none;
  resize: none;
  outline: none;
  border-bottom: 1px solid #1e293b;
}

/* ===== IFRAME PREVIEW ===== */
#cg-iframe {
  flex: 1;
  width: 100%;
  border: none;
  background: #fff;
}

/* ===== MOBILE ===== */
@media (max-width: 768px) {
  .cg-modal-box {
    height: 95%;
  }

  .cg-toolbar {
    flex-wrap: wrap;
    gap: 6px;
  }

  #cg-editor {
    font-size: 13px;
  }
}
